Dialog
Opens focused modal content without navigating away from the current page.
Imports
Use the same component slug for React, Vue, and style token lookup. Do not import components from package roots.
import { Dialog, DialogTrigger, DialogContent, DialogTitle, DialogDescription } from "@line/abc-def-react/dialog";<script setup lang="ts">
import { Dialog, DialogTrigger, DialogContent, DialogTitle, DialogDescription } from "@line/abc-def-vue/dialog";
</script>Shadcn references
Compare the corresponding shadcn React and Vue documentation for the same component slug.
Basic usage
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@line/abc-def-react/dialog";
import { Button } from "@line/abc-def-react/button";
export function Example() {
return (
<Dialog>
<DialogTrigger asChild><Button>Open dialog</Button></DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Edit token</DialogTitle>
<DialogDescription>Change a scoped CSS variable.</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>
);
}<script setup lang="ts">
import { Button } from "@line/abc-def-vue/button";
import {
Dialog,
DialogContent,
DialogDescription,
DialogHeader,
DialogTitle,
DialogTrigger,
} from "@line/abc-def-vue/dialog";
</script>
<template>
<Dialog>
<DialogTrigger :as-child="true">
<Button>Open dialog</Button>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>Edit token</DialogTitle>
<DialogDescription>
Change a scoped CSS variable.
</DialogDescription>
</DialogHeader>
</DialogContent>
</Dialog>
</template>Component tokens
| Component Token | Semantic Token | Default Primitive Token |
|---|---|---|
--dialog-overlay-bg | Literal value | rgb(0 0 0 / 0.1) |
--dialog-content-bg | --popover | --color-white |
--dialog-content-fg | --popover-foreground | --color-zinc-950 |
--dialog-content-border | --foreground | --color-zinc-950 |
--dialog-footer-bg | --muted | --color-zinc-100 |
--dialog-footer-border | --border | --color-zinc-200 |
--dialog-description-fg | --muted-foreground | --color-zinc-500 |
Composition exports
DialogDialogTriggerDialogContentDialogTitleDialogDescriptionUsage notes
- Use for focused tasks.
- Keep long flows on full pages when possible.
- Related component tokens use the `dialog` token group in `@line/abc-def-styles/css`.