Collapsible
Generated from public Vue/TypeScript exports by
pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
Collapsible
import { Collapsible } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
defaultOpen | boolean | undefined | — | The open state of the collapsible when it is initially rendered. <br> Use when you do not need to control its open state. |
open | boolean | undefined | — | The controlled open state of the collapsible. Can be binded with v-model. |
disabled | boolean | undefined | — | When true, prevents the user from interacting with the collapsible. |
unmountOnHide | boolean | undefined | — | When true, the element will be unmounted on closed state. |
asChild | boolean | undefined | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
update:open | [value: boolean] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | { open: boolean; } | — | — |
Examples
These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '.'
import { Button } from '../button'
import { ref } from 'vue'
{
render: () => ({
components: { Collapsible, CollapsibleContent, CollapsibleTrigger, Button },
setup() {
const isOpen = ref(false)
return { isOpen }
},
template: `
<Collapsible v-model:open="isOpen" class="w-full max-w-sm space-y-2">
<div class="flex items-center justify-between space-x-4 px-4">
<h4 class="text-sm font-semibold text-foreground">
@peduarte starred 3 repositories
</h4>
<CollapsibleTrigger as-child>
<Button variant="ghost" size="sm" class="w-9 p-0">
<span class="text-xs">{{ isOpen ? '−' : '+' }}</span>
<span class="sr-only">Toggle</span>
</Button>
</CollapsibleTrigger>
</div>
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@radix-ui/primitives
</div>
<CollapsibleContent class="space-y-2">
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@radix-ui/colors
</div>
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@stitches/react
</div>
</CollapsibleContent>
</Collapsible>
`,
}),
}
CollapsibleContent
import { CollapsibleContent } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
forceMount | boolean | undefined | — | Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. |
asChild | boolean | undefined | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '.'
import { Button } from '../button'
import { ref } from 'vue'
{
render: () => ({
components: { Collapsible, CollapsibleContent, CollapsibleTrigger, Button },
setup() {
const isOpen = ref(false)
return { isOpen }
},
template: `
<Collapsible v-model:open="isOpen" class="w-full max-w-sm space-y-2">
<div class="flex items-center justify-between space-x-4 px-4">
<h4 class="text-sm font-semibold text-foreground">
@peduarte starred 3 repositories
</h4>
<CollapsibleTrigger as-child>
<Button variant="ghost" size="sm" class="w-9 p-0">
<span class="text-xs">{{ isOpen ? '−' : '+' }}</span>
<span class="sr-only">Toggle</span>
</Button>
</CollapsibleTrigger>
</div>
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@radix-ui/primitives
</div>
<CollapsibleContent class="space-y-2">
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@radix-ui/colors
</div>
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@stitches/react
</div>
</CollapsibleContent>
</Collapsible>
`,
}),
}
CollapsibleTrigger
import { CollapsibleTrigger } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
asChild | boolean | undefined | — | Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
Examples
These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '.'
import { Button } from '../button'
import { ref } from 'vue'
{
render: () => ({
components: { Collapsible, CollapsibleContent, CollapsibleTrigger, Button },
setup() {
const isOpen = ref(false)
return { isOpen }
},
template: `
<Collapsible v-model:open="isOpen" class="w-full max-w-sm space-y-2">
<div class="flex items-center justify-between space-x-4 px-4">
<h4 class="text-sm font-semibold text-foreground">
@peduarte starred 3 repositories
</h4>
<CollapsibleTrigger as-child>
<Button variant="ghost" size="sm" class="w-9 p-0">
<span class="text-xs">{{ isOpen ? '−' : '+' }}</span>
<span class="sr-only">Toggle</span>
</Button>
</CollapsibleTrigger>
</div>
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@radix-ui/primitives
</div>
<CollapsibleContent class="space-y-2">
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@radix-ui/colors
</div>
<div class="rounded-md border px-4 py-3 font-mono text-sm text-foreground">
@stitches/react
</div>
</CollapsibleContent>
</Collapsible>
`,
}),
}