Skip to main content

Callout

Emphasize important information. Guide users effectively.

Note
The CLI reads NACHUI_TOKEN from your shell first, then falls back to .env.local. Values in the shell always win.
1import { Callout } from '@/components/ui/callout';
2
3export function Default() {
4 return (
5 <Callout className="max-w-lg">
6 <Callout.Title>Note</Callout.Title>
7 <Callout.Content>
8 The CLI reads NACHUI_TOKEN from your shell first, then falls back to .env.local. Values in
9 the shell always win.
10 </Callout.Content>
11 </Callout>
12 );
13}

Installation

pnpm dlx nachui add callout

Anatomy

1import { Callout } from '@/components/ui/callout';
1<Callout variant="info">
2 <Callout.Title>Note</Callout.Title>
3 <Callout.Content>This is a callout with information.</Callout.Content>
4</Callout>

Composition

Use the following composition to build a Callout:
Callout
├── Callout.Title
└── Callout.Content

Variants

info

Good to know
Preview deploys are kept for 30 days and then removed. Promote one to production if you need the URL to stay reachable.
1import { Callout } from '@/components/ui/callout';
2
3export function Info() {
4 return (
5 <Callout variant="info" className="max-w-lg">
6 <Callout.Title>Good to know</Callout.Title>
7 <Callout.Content>
8 Preview deploys are kept for 30 days and then removed. Promote one to production if you need
9 the URL to stay reachable.
10 </Callout.Content>
11 </Callout>
12 );
13}

warning

Breaking change in v3.0
Button no longer forwards the asChild prop. Wrap the child in Slot yourself before you upgrade, or the link inside it renders as a nested button.
1import { Callout } from '@/components/ui/callout';
2
3export function Warning() {
4 return (
5 <Callout variant="warning" className="max-w-lg">
6 <Callout.Title>Breaking change in v3.0</Callout.Title>
7 <Callout.Content>
8 Button no longer forwards the asChild prop. Wrap the child in Slot yourself before you
9 upgrade, or the link inside it renders as a nested button.
10 </Callout.Content>
11 </Callout>
12 );
13}

danger

This cannot be undone
Deleting a project removes its deploys, environment variables, and request logs. Custom domains are released and can be claimed by anyone.
1import { Callout } from '@/components/ui/callout';
2
3export function Danger() {
4 return (
5 <Callout variant="danger" className="max-w-lg">
6 <Callout.Title>This cannot be undone</Callout.Title>
7 <Callout.Content>
8 Deleting a project removes its deploys, environment variables, and request logs. Custom
9 domains are released and can be claimed by anyone.
10 </Callout.Content>
11 </Callout>
12 );
13}

success

Recommended
Since v2.3 the compiler memoizes render output for you. New code can drop manual useMemo and useCallback wrappers around cheap values.
1import { Callout } from '@/components/ui/callout';
2
3export function Success() {
4 return (
5 <Callout variant="success" className="max-w-lg">
6 <Callout.Title>Recommended</Callout.Title>
7 <Callout.Content>
8 Since v2.3 the compiler memoizes render output for you. New code can drop manual useMemo and
9 useCallback wrappers around cheap values.
10 </Callout.Content>
11 </Callout>
12 );
13}

Custom Icon

You can override the default icon by providing the icon prop to Callout.
1<Callout icon={<MyCustomIcon />}>
2 <Callout.Title>Custom</Callout.Title>
3 <Callout.Content>Callout with custom icon</Callout.Content>
4</Callout>

API Reference

Callout

PropTypeDefaultDescription
variant"default" | "info" | "warning" | "danger" | "success""default"Controls the visual treatment and surface colors.
iconReact.ReactNodeOptional custom icon.
classNamestringAdditional CSS class names.
childrenReact.ReactNodeCompose the callout with Title and Content.

Callout.Title

PropTypeDefaultDescription
childrenReact.ReactNodeHeading text for the callout.
classNamestringAdditional CSS class names.

Callout.Content

PropTypeDefaultDescription
childrenReact.ReactNodeBody copy inside the callout.
classNamestringAdditional CSS class names.
Found something to improve?

Notice a bug, typo, or missing detail on this page? Help us make the documentation better by opening a GitHub issue.

Create an Issue
Ctrl+I