Skip to content

Callout

import { Callout } from '@delightstack/components';

Your changes are automatically saved.

View code
<Callout>
Your changes are automatically saved.
</Callout>

Use boolean props to set the visual variant. When none is set, the default info style is used.

Info (default)

This is an informational callout.

View code
<Callout>
This is an informational callout.
</Callout>
Success

Your changes have been saved successfully.

View code
<Callout success>
Your changes have been saved successfully.
</Callout>
Warning
View code
<Callout warning title="Heads up">
This action cannot be undone.
</Callout>
Error
View code
<Callout error>
Failed to connect to the server. Please try again.
</Callout>
Tip
Pro Tip

Press Cmd+K to open the command palette.

View code
<Callout tip title="Pro Tip">
Press Cmd+K to open the command palette.
</Callout>

Add dismissible to show a close button. Use ondismiss to handle the event.

Pro Tip
You can use keyboard shortcuts to speed up your workflow.
View code
<script>
import { Callout } from '@delightstack/components';
let visible = $state(true);
</script>
{#if visible}
<Callout tip title="Pro Tip" dismissible ondismiss={() => (visible = false)}>
You can use keyboard shortcuts to speed up your workflow.
</Callout>
{/if}

Override the default icon or add an action area using snippets.

New feature available! Check out our latest update with improved performance and new components.
View code
<script>
import { Callout } from '@delightstack/components';
import { Button } from '@delightstack/components';
</script>
<Callout>
{#snippet icon()}
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z" />
<path d="M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z" />
</svg>
{/snippet}
New feature available! Check out our latest update with improved performance.
{#snippet action()}
<Button size="0" transparent>Learn more</Button>
{/snippet}
</Callout>

Set banner for a full-width banner with solid background. Combine with sticky to pin it to the top on scroll.

View code
<script>
import { Callout } from '@delightstack/components';
let showBanner = $state(true);
</script>
{#if showBanner}
<Callout banner dismissible ondismiss={() => showBanner = false}>
We've updated our privacy policy. Please review the changes.
{#snippet action()}
<a href="/privacy">Learn more</a>
{/snippet}
</Callout>
{/if}
<Callout banner warning>
Scheduled maintenance tonight at 11pm UTC.
</Callout>
Compact callout with less padding.
Spacious callout with more padding.
View code
<Callout dense>Compact callout with less padding.</Callout>
<Callout comfortable>Spacious callout with more padding.</Callout>
View code
<Callout skeleton={loading}></Callout>
PropTypeDefaultDescription
successbooleanfalseSuccess variant (green)
warningbooleanfalseWarning variant (yellow/orange)
errorbooleanfalseError variant (red)
tipbooleanfalseTip variant (accent/purple)
bannerbooleanfalseFull-width banner mode with solid background
titlestring''Optional heading text
dismissiblebooleanfalseShow close/dismiss button
stickybooleanfalseStick to top on scroll (banner mode only)
densebooleanfalseCompact padding
comfortablebooleanfalseRelaxed padding
skeletonbooleanfalseShow loading skeleton state
idstringautoElement ID
classstring''Additional CSS classes
childrenSnippet-Main content
iconSnippet-Custom icon (overrides default variant icon)
actionSnippet-Action area (button, link, etc.)
EventDetailDescription
ondismiss() => voidCalled when the dismiss button is clicked
  • Uses role="alert" for warning and error variants
  • Uses role="status" for info, success, and tip variants
  • Banner mode renders as a semantic <aside> element, inline mode uses <div>
  • Icon has aria-hidden="true"
  • Dismiss button has aria-label="Dismiss"
  • Respects prefers-reduced-motion (disables slide/scale animations)