Skip to main content

Overview

The Callout component displays highlighted blocks of important information with semantic color variants and optional icons. Ideal for tips, warnings, errors, and informational notes.

Import

Basic Usage

Variants

The Callout component supports four semantic variants, each with a unique icon:
Blue accent styling with info icon (ℹ). This is the default variant.

Props

'info' | 'warning' | 'danger' | 'tip'
default:"info"
The semantic variant of the callout.
string
Optional title displayed above the content in semibold text.
ReactNode
required
The content of the callout.
string
Additional CSS classes to apply.
The Callout component extends HTMLAttributes<HTMLDivElement>, so all standard div attributes are supported.

Design Details

  • Flex layout with 12px gap between icon and content
  • Rounded corners with border
  • 14px (sm) text size
  • Icon sized at 16px (base) with matching variant color
  • Icon has aria-hidden="true" for accessibility
  • Uses role="note" for semantic HTML

Examples

With Title

Info Callout

Danger Callout

Tip Callout

With Formatted Content

The content area has [&_p]:m-0 to remove default paragraph margins.

Accessibility

  • Icon is hidden from screen readers with aria-hidden="true"
  • Semantic role="note" attribute
  • Color is not the only indicator (icons provide additional context)

Component Definition

Location: packages/gadget-ui/src/components/callout.tsx:39