Callout
Dismissible alert box with tone-driven coloring, frame variants (inline / rail / bar), and a compound API.
Installation
dgadd ships in @diffgazer/add on npm: pnpm add -D @diffgazer/add puts it on pnpm exec, and npx @diffgazer/add runs it without the install.
UI components require Tailwind CSS v4. Local copy mode imports src/styles/styles.css; package mode uses @diffgazer/ui CSS from the installed package.
Usage
Examples
Tones
Frames
Controlled visibility
Custom icon
API Reference
Callout
Callout.Icon
Callout.Title
Callout.Content
Callout.Dismiss
Accessibility
Notes
Compound Components
Compose Callout.Icon, Callout.Title, Callout.Content, and Callout.Dismiss as children. Each part inherits the tone from the root Callout via context.
Frame variants
frame="inline" (default): hairline border at tone color + subtle tone bg. frame="rail": no border, 2px inline-start rail at tone color. frame="bar": neutral border + 4px tone marker bar.
Default icons
Each tone ships a default character glyph (i / ! / ✕ / ✓), the same icon language Toast uses. Pass children to Callout.Icon to override with any ReactNode, including an SVG.
Dismissible
Add Callout.Dismiss as a child to show a close button. In uncontrolled mode the callout self-dismisses. For controlled mode, pass open and onOpenChange to the root Callout.
Accessibility
Static callouts have no role. Pass live to opt into role="status" (or role="alert" for tone="error") so assistive tech announces the message. A visually-hidden tone prefix ("Warning:", "Error:", …) is always rendered so the message is unambiguous without color.
Source
Install via CLI: pnpm exec dgadd add ui/callout. Keyboard hooks are included as standalone copies. For the full experience, use --integration keys.
Highlighted source loads after this disclosure opens. Browse the source repository.