Collapsible
Toggle content visibility with smooth expand and collapse animations.
Usage
Wrap your content with the collapsible component to display a Collapsible in your content.
| Prop | Default | Type |
|---|---|---|
name | string | |
size | md | string |
color | neutral | string |
::collapsible
| Prop | Default | Type |
|---------|-----------|--------------------------|
| `name` | | `string` |
| `size` | `md` | `string` |
| `color` | `neutral` | `string` |
::
API
Props
| Prop | Default | Type |
|---|---|---|
icon | appConfig.pohon.icons.chevronDown | string | objectThe icon displayed to toggle the collapsible. |
name | t('prose.collapsible.name') | stringThe name displayed in the trigger label. |
openText | t('prose.collapsible.openText') | stringThe text displayed when the collapsible is open. |
closeText | t('prose.collapsible.closeText') | stringThe text displayed when the collapsible is closed. |
pohon | { root?: ClassValue; trigger?: ClassValue; triggerIcon?: ClassValue; triggerLabel?: ClassValue; content?: ClassValue; } |
Slots
| Slot | Type |
|---|---|
default | object |
Theme
We use unocss-variants to customize the theme. Read more about it in the theming guide.
Below is the theme configuration skeleton for the ProseCollapsible. Since the component is provided unstyled by default, you will need to fill in these values to apply your own custom look and feel. If you prefer to use our pre-built, opinionated styling, you can instead use our UnoCSS preset, this docs is using it as well.
app.config.ts
export default defineAppConfig({
pohon: {
prose: {
collapsible: {
slots: {
root: '',
trigger: '',
triggerIcon: '',
triggerLabel: '',
content: ''
}
}
}
}
};
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import pohon from 'pohon-ui/vite'
export default defineAppConfig({
pohon: {
prose: {
collapsible: {
slots: {
root: '',
trigger: '',
triggerIcon: '',
triggerLabel: '',
content: ''
}
}
}
}
};
Changelog
No recent changes