Dialog
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.
Dialog
import { Dialog } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
open | boolean | undefined | — | The controlled open state of the dialog. Can be binded as v-model:open. |
defaultOpen | boolean | undefined | — | The open state of the dialog when it is initially rendered. Use when you do not need to control its open state. |
modal | boolean | undefined | — | The modality of the dialog When set to true, <br> interaction with outside elements will be disabled and only dialog content will be visible to screen readers. |
unmountOnHide | boolean | undefined | — | When set to false, the dialog content will not be unmounted when closed, but instead hidden with CSS. <br> Useful for SEO or when you want to improve performance by not remounting the component on every open. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
update:open | [value: boolean] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
DialogClose
import { DialogClose } 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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
DialogContent
import { DialogContent } 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. |
disableOutsidePointerEvents | boolean | undefined | — | When true, hover/focus/click interactions will be disabled on elements outside the DismissableLayer. Users will need to click twice on outside elements to interact with them: once to close the DismissableLayer, and again to trigger the element. |
portalTo | string | HTMLElement | undefined | — | — |
disablePortal | boolean | undefined | — | — |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
escapeKeyDown | [event: KeyboardEvent] | — | — |
pointerDownOutside | [event: PointerDownOutsideEvent] | — | — |
focusOutside | [event: FocusOutsideEvent] | — | — |
interactOutside | [event: PointerDownOutsideEvent | FocusOutsideEvent] | — | — |
openAutoFocus | [event: Event] | — | — |
closeAutoFocus | [event: Event] | — | — |
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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
DialogDescription
import { DialogDescription } 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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
DialogFooter
import { DialogFooter } from '@gxp-dev/app-ui'
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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
DialogHeader
import { DialogHeader } from '@gxp-dev/app-ui'
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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
DialogScrollContent
import { DialogScrollContent } 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. |
disableOutsidePointerEvents | boolean | undefined | — | When true, hover/focus/click interactions will be disabled on elements outside the DismissableLayer. Users will need to click twice on outside elements to interact with them: once to close the DismissableLayer, and again to trigger the element. |
portalTo | string | HTMLElement | undefined | — | — |
disablePortal | boolean | undefined | — | — |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
escapeKeyDown | [event: KeyboardEvent] | — | — |
pointerDownOutside | [event: PointerDownOutsideEvent] | — | — |
focusOutside | [event: FocusOutsideEvent] | — | — |
interactOutside | [event: PointerDownOutsideEvent | FocusOutsideEvent] | — | — |
openAutoFocus | [event: Event] | — | — |
closeAutoFocus | [event: Event] | — | — |
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.
ScrollableContent
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Scrollable Content',
render: () => ({
components: {
Dialog,
DialogScrollContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Terms of Service</Button>
</DialogTrigger>
<DialogScrollContent class="sm:max-w-[500px]">
<DialogHeader>
<DialogTitle>Terms of Service</DialogTitle>
<DialogDescription>
Please read the following terms carefully.
</DialogDescription>
</DialogHeader>
<div class="space-y-4 py-4 text-sm text-muted-foreground">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.</p>
<p>Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p>
<p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem.</p>
<p>Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur.</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Decline</Button>
</DialogClose>
<Button>Accept</Button>
</DialogFooter>
</DialogScrollContent>
</Dialog>
`,
}),
}
Showcase
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Showcase',
render: () => ({
components: {
Dialog,
DialogContent,
DialogScrollContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Basic Dialog</h3>
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Open Basic Dialog</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Basic Dialog</DialogTitle>
<DialogDescription>
A simple dialog with a title, description, and action buttons.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">This is the dialog body content.</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Close</Button>
</DialogClose>
<Button>Continue</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Form Dialog</h3>
<Dialog>
<DialogTrigger as-child>
<Button>Open Form Dialog</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Update your profile information below.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="showcase-name" class="text-right">Name</Label>
<Input id="showcase-name" value="Jane Smith" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="showcase-email" class="text-right">Email</Label>
<Input id="showcase-email" value="jane@example.com" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Destructive Confirmation</h3>
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Item</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Confirm Deletion</DialogTitle>
<DialogDescription>
This action cannot be undone. Are you sure you want to permanently delete this item?
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Scrollable Dialog</h3>
<Dialog>
<DialogTrigger as-child>
<Button variant="secondary">Open Scrollable Dialog</Button>
</DialogTrigger>
<DialogScrollContent class="sm:max-w-[500px]">
<DialogHeader>
<DialogTitle>License Agreement</DialogTitle>
<DialogDescription>
Review the license terms below.
</DialogDescription>
</DialogHeader>
<div class="space-y-4 py-4 text-sm text-muted-foreground">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.</p>
<p>Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Decline</Button>
</DialogClose>
<Button>Accept</Button>
</DialogFooter>
</DialogScrollContent>
</Dialog>
</div>
</div>
`,
}),
}
DialogTitle
import { DialogTitle } 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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
DialogTrigger
import { DialogTrigger } 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 {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="outline">Edit Profile</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Edit Profile</DialogTitle>
<DialogDescription>
Make changes to your profile here. Click save when you're done.
</DialogDescription>
</DialogHeader>
<div class="py-4">
<p class="text-sm text-muted-foreground">
Your profile settings will be updated across all devices.
</p>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button>Save changes</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
WithForm
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'With Form',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
Input,
Label,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button>Create Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>Create Account</DialogTitle>
<DialogDescription>
Enter your details below to create a new account.
</DialogDescription>
</DialogHeader>
<div class="grid gap-4 py-4">
<div class="grid grid-cols-4 items-center gap-4">
<Label for="name" class="text-right">Name</Label>
<Input id="name" placeholder="John Doe" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="email" class="text-right">Email</Label>
<Input id="email" type="email" placeholder="john@example.com" class="col-span-3" />
</div>
<div class="grid grid-cols-4 items-center gap-4">
<Label for="password" class="text-right">Password</Label>
<Input id="password" type="password" placeholder="Enter password" class="col-span-3" />
</div>
</div>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button type="submit">Create</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}
Confirmation
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
DialogScrollContent,
} from '.'
import { Button } from '../button'
import { Input } from '../input'
import { Label } from '../label'
{
name: 'Confirmation Dialog',
render: () => ({
components: {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
DialogClose,
Button,
},
template: `
<Dialog>
<DialogTrigger as-child>
<Button variant="destructive">Delete Account</Button>
</DialogTrigger>
<DialogContent class="sm:max-w-[400px]">
<DialogHeader>
<DialogTitle>Are you sure?</DialogTitle>
<DialogDescription>
This action cannot be undone. This will permanently delete your account
and remove your data from our servers.
</DialogDescription>
</DialogHeader>
<DialogFooter>
<DialogClose as-child>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button variant="destructive">Delete</Button>
</DialogFooter>
</DialogContent>
</Dialog>
`,
}),
}