# Collapsible (@limerdev/zest) One section that opens and closes: `` (`bind:open`) holds a `Collapsible.Trigger` (a button; render your own with the `child` snippet) and a `Collapsible.Content`, which slides open. - Category: Layout - Import: `import { Collapsible } from '@limerdev/zest'` - Bits UI: `Collapsible`, https://bits-ui.com/docs/components/collapsible - Exports: `Collapsible.Root`, `Collapsible.Trigger`, `Collapsible.Content` - Use for: Optional detail under something visible: advanced options in a form, the lines behind a total, older entries. - Don't: Several sections under headings: use `Accordion`. Content everyone needs: show it. ```svelte Advanced options … ``` Props of `Collapsible.Root`: - `disabled` (`boolean`, default `false`): Whether the collapsible is disabled. - `onOpenChange` (`OnChangeFn`): A callback function called when the open state changes. - `onOpenChangeComplete` (`OnChangeFn`): A callback function called when the open state changes complete. - `open` (`boolean`, default `false`, bindable): Whether the collapsible is open. Props of `Collapsible.Trigger`: - `size` (`"default" | "sm" | "lg" | "icon" | "icon-sm" | "icon-lg"`, default `'default'`): The height and padding, from the theme's field size; the `icon` sizes are square. - `variant` (`"link" | "primary" | "secondary" | "neutral" | "error" | "outline" | "ghost"`, default `'primary'`): The look, by the theme's colour roles: `primary` for the main action, `error` for deleting, `secondary`, `neutral` and `outline` for the rest, `ghost` in toolbars, `link` for a navigation that looks like text. Props of `Collapsible.Content`: - `forceMount` (`boolean`, default `false`): Whether to force mount the content to the DOM. - `hiddenUntilFound` (`boolean`, default `true`): Whether to allow the browser to expand the content when searching for content within the panel via the browser's built-in search functionality. When `true`, this prop will override the `forceMount` prop. Example: Basic Optional detail under a total. The trigger is your own Button through child. ```svelte

Invoice 1042 · 12 400 kr

  • Development · 24 h · 9 600 kr
  • Design · 7 h · 2 800 kr
```