An aside in the flow of a page: a tip or a caveat on a calm card, with a breath of its color in the corner.
$ pnpm dlx shadcn@latest add https://dashral.com/r/note.jsonInstallation
$ pnpm dlx shadcn@latest add https://dashral.com/r/note.jsonAdds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:
{
"registries": {
"@dashral": "https://dashral.com/r/{name}.json"
}
}Then add components by name:
$ pnpm dlx shadcn@latest add @dashral/noteUsage
import { Note } from "@/components/dashral/note"
<Note color="success" title="Good to know">
<p>Test keys start with <code>sk_test_</code> and never touch live data.</p>
</Note>Examples
API reference
Note
Also takes every prop of <div>(opens in a new tab).
| Prop | Type | Default |
|---|---|---|
title | ReactNodeThe heading beside the icon, e.g. “Good to know”. | — |
color | "neutral" | "primary" | "info" | "success" | "warning" | "destructive" | "highlight"Tints the corner light and the icon; each color brings a fitting icon. | "neutral" |
icon | ReactNode | falseReplaces the icon; false shows none. | the color's |
children | ReactNodeThe text: paragraphs, lists, links and code read as they do around it. | — |
classNames | { icon, title, body }Classes for each part. | — |
className | stringExtra classes, merged with cn() so yours win. | — |
Accessibility
- role="note": an aside to the content around it, read in place and never announced. For a status that must be heard (saved, failed), use Alert.
- The icon is decorative; the title and the text carry the meaning, so it never relies on color.