Skip to content
Feedback

Alert

An inline message in six tones, optionally dismissible.

import
import { Alert } from '@joshicodes/cock';

Tones

Behaviour

  • Alerts stay in the layout and stay put. For something that happened elsewhere, use a toast.

API

Read out of the component sources at build time, so it matches the version you installed. Every component also takes class, merged through tailwind-merge so your utility wins.

Props of Alert

PropTypeDefault
variant
AlertVariant'neutral'
title
string—
class
string—

Snippets of Alert

SnippetTypeDefault
icon

Replace the built-in status glyph.

Snippet—
children
Snippet—

Events of Alert

EventTypeDefault
ondismiss

Renders a dismiss button and calls back when pressed.

() => void—

See also

cock. Yes, it stands for core component kit. We checked twice.