blackchalkv0.3.0
Components

Alert

SketchAlert — an inline status banner with a hand-drawn border and leading icon.

SketchAlert renders an inline status or info banner. It uses a rough.js border via SketchCard, a leading icon to convey severity, and a monochrome palette — variants are distinguished by icon, not colour.

Default

import { SketchAlert } from "blackchalk";<SketchAlert title="Heads up" variant="info">Your trial ends in 3 days.</SketchAlert>

Variants

<SketchAlert title="Saved" variant="success">Your changes have been published.</SketchAlert><SketchAlert title="Low on credits" variant="warning">You have 2 generations left.</SketchAlert><SketchAlert title="Something went wrong" variant="error" onClose={() => {}}>We couldn't save your changes. Try again.</SketchAlert>

Props

PropTypeDefault
variant"info" | "success" | "warning" | "error""info"
titlestring
childrenReactNode
iconIconName
onClose() => void
styleCSSProperties

See it in the Storybook playground, or read the source.

On this page