Zudoku
General

Callout

A callout component to draw attention to important information.

Writing Markdown? Use the admonitions shorthand (:::tip) instead of the component directly.

Import

ReactCode
import { Callout } from "zudoku/ui/Callout";

Note

Hey, listen!

This draws attention to important information.

ReactCode
<Callout type="note" title="Hey, listen!"> This draws attention to important information. </Callout>

Info

It's safe to use the info

This adds info to your content.

ReactCode
<Callout type="info" title="It's safe to use the info"> This adds info to your content. </Callout>

Tip

You'll be successful

If you choose to be.

ReactCode
<Callout type="tip" title="You'll be successful"> If you choose to be. </Callout>

Danger

But some things are dangerous

It's dangerous to go alone, take this.

ReactCode
<Callout type="danger" title="But some things are dangerous"> It's dangerous to go alone, take this. </Callout>

Caution

So, better show a warning

This raises a warning to watch out for.

ReactCode
<Callout type="caution" title="So, better show a warning"> This raises a warning to watch out for. </Callout>

Sparkles

What's new

Highlight new features or AI-powered functionality.

ReactCode
<Callout type="sparkles" title="What's new"> Highlight new features or AI-powered functionality. </Callout>

Rocket

Getting started

Spin up your first project in minutes.

ReactCode
<Callout type="rocket" title="Getting started"> Spin up your first project in minutes. </Callout>

Settings

Configuration

Tweak these options to match your workflow.

ReactCode
<Callout type="settings" title="Configuration"> Tweak these options to match your workflow. </Callout>

Zap

Performance

Use this pattern when latency matters.

ReactCode
<Callout type="zap" title="Performance"> Use this pattern when latency matters. </Callout>

Lock

Authentication required

This endpoint needs a valid API key.

ReactCode
<Callout type="lock" title="Authentication required"> This endpoint needs a valid API key. </Callout>

Megaphone

Announcement

We've just shipped a breaking change to the v2 API.

ReactCode
<Callout type="megaphone" title="Announcement"> We've just shipped a breaking change to the v2 API. </Callout>

Variations

Callouts can be customized by omitting the title or icon:

Without a title

Without an icon

You can hide the icon while keeping the title

Or have neither title nor icon

Or pass any React node as the icon to override the default for the chosen type:

Made with love

The icon inherits the type's accent color.

ReactCode
<Callout type="note"> Without a title </Callout> <Callout type="note" icon={false} title="Without an icon"> You can hide the icon while keeping the title </Callout> <Callout type="note" icon={false}> Or have neither title nor icon </Callout> <Callout type="tip" icon={<FileHeartIcon />} title="Made with love"> The icon inherits the type's accent color. </Callout>

Customize colors

Each callout type is driven by a single CSS variable that determines the icon, border tint, and background tint via color-mix. Override any of them in your stylesheet to recolor a type globally:

CSSCode
:root { --callout-tip: oklch(0.65 0.18 160); --callout-sparkles: oklch(0.6 0.22 320); } .dark { --callout-tip: oklch(0.78 0.18 160); --callout-sparkles: oklch(0.75 0.2 320); }

All available variables:

CSSCode
--callout-note --callout-tip --callout-info --callout-caution --callout-danger --callout-sparkles --callout-rocket --callout-settings --callout-zap --callout-lock --callout-megaphone
Last modified on