Skip to main content
Version: v1 (Current)

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 commit fc6bfb108634735f1657e533206c3f8702ad357d; 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'

Repository source

Props​

NameTypeRequired / defaultDescription
defaultOpenboolean | undefined—The open state of the collapsible when it is initially rendered. <br> Use when you do not need to control its open state.
openboolean | undefined—The controlled open state of the collapsible. Can be binded with v-model.
disabledboolean | undefined—When true, prevents the user from interacting with the collapsible.
unmountOnHideboolean | undefined—When true, the element will be unmounted on closed state.
asChildboolean | 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.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Events​

NameTypeRequired / defaultDescription
update:open[value: boolean]——

Slots​

NameTypeRequired / defaultDescription
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'

Repository source

Props​

NameTypeRequired / defaultDescription
forceMountboolean | undefined—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
asChildboolean | 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.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
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'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | 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.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
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>
`,
}),
}