v2.15.0

ProseCollapsible

Блок содержимого, который плавно сворачивается и разворачивается.

Использование

Компонент collapsible показывает Collapsible в содержимом.

::collapsible

| Пропс   | По умолчанию | Тип                   |
|---------|-----------|--------------------------|
| `name`  |           | `string`{lang="ts-type"} |
| `size`  | `md`      | `string`{lang="ts-type"} |
| `color` | `neutral` | `string`{lang="ts-type"} |

::

API

Пропсы

Prop Default Type
iconicons.chevronDownIconComponent

The icon displayed to toggle the collapsible.

namet('prose.collapsible.name') string

The name displayed in the trigger label.

openTextt('prose.collapsible.openText') string

The text displayed when the collapsible is open.

closeTextt('prose.collapsible.closeText') string

The text displayed when the collapsible is closed.

b24ui { root?: SlotClass; trigger?: SlotClass; triggerIcon?: SlotClass; triggerLabel?: SlotClass; content?: SlotClass; } & { root?: SlotClass; content?: SlotClass; }

Слоты

Slot Type
default{}

Тема

https://github.com/bx-shef/b24-ui/tree/main/src/theme/collapsible.ts
export default {
  slots: {
    root: 'my-[20px]',
    trigger: 'group relative rounded-(--ui-border-radius-md) inline-flex items-center gap-[4px] text-description hover:text-label text-(length:--ui-font-size-3xs) leading-(--ui-font-line-height-2xs) focus-visible:ring-2 focus-visible:ring-(--ui-color-design-selection-stroke) focus:outline-none cursor-pointer transition-colors',
    triggerIcon: 'size-[14px] shrink-0 motion-safe:group-data-[state=open]:rotate-180 transition-transform duration-200',
    triggerLabel: 'truncate',
    content: '*:first:mt-2.5 *:last:mb-0 *:my-1.5'
  }
}