Skip to content

No.349 · Feedback· New

Alert Callout

Inline alerts in four tones (information, success, warning, danger), each with its own mark, a short title, a sentence, the actions that resolve it and a close button that folds the message away smoothly. As tinted boxes, hairline boxes, accent-barred notes or full-width banners.

The prompt

Copy this text

Automatic copying is unavailable. Copy the selected text using your device’s copy command.

Written for the variant you picked above: Soft

Build an inline alert component in four tones, in the single presentation selected below. Inter 14.5px/1.5. Anatomy: a three-column grid (20px mark, text, an optional close button). Marks are line icons in the tone: a circled i, a circled tick, a triangle with a stroke and dot, and an octagon with a stroke and dot. Text: a 600-weight title, then a muted sentence, then actions: an optional small filled button in the tone (7px radius, page-coloured text) and text links in the tone with a faint underline that firms up on hover. Tones (light / dark), colour then tint then hairline: info #1d4fd8 #eef3ff #c9d8fd / #8db3ff #0f1a30 #22385f; success #13703a #ebf7ef #bfe3cb / #6fdc93 #0e2015 #1f4329; warning #8a5900 #fdf5e1 #f0d9a0 / #f8c45c #241b08 #4d3a14; danger #c0161c #fdeeee #f5c6c7 / #ff8a8d #2a1113 #5a2226. Text #1d1e21 / #e8e9ec, muted #4a4d55 / #b0b3ba. Entering, it fades down 4px. The close button (28px, labelled 'Dismiss: <title>') folds it away: animate grid-template-rows from 1fr to 0fr with the opacity over 0.26s, then remove it. Show four examples ('A new version is ready', 'Payment received', 'Your trial ends in 3 days' with 'Add card', 'Deploy failed' with 'View logs' and 'Retry') on a #f7f7f6 panel and a #0b0b0c panel side by side, with a way to bring dismissed ones back. Selected variant — Soft (soft): Soft: a 12px-radius box in the tone's tint with a 1px inset hairline in the tone, 14px padding (16px on the left). This selection takes precedence over references to other themes or options in the general brief. Implement this selected appearance; do not add a variant picker or alternative appearances unless requested. Implementation requirements: Use React and TypeScript. Keep the component self-contained, with uniquely scoped CSS and no animation libraries. Include required imports, styles and font setup in the result. Interaction: Actions are buttons or links; the close button removes the alert after it folds. Motion: A 0.28s entrance and a 0.26s fold on dismiss; none with reduced motion. Accessibility: Danger uses role=alert so it's announced at once; the others use role=status. Each close button names the alert it closes, and after a dismissal keyboard focus moves to the neighbouring alert's close button. The mark is decorative; the tone is also in the title. Responsive behavior: Text wraps under the title; banner actions drop to their own line on narrow screens. Touch: 28px close targets inside a padded box; nothing relies on hover. Preserve keyboard access, visible focus and reduced-motion behavior. Keep fictional demo data and simulated service calls in a separate usage example; expose callbacks for real actions and recover from rejected requests. Keep usage-example links inside the demo: use local buttons or prevent navigation. Demonstration links must not navigate to Vitrine routes or open other pages; preserve real URL support in the reusable component itself. Verify the result at narrow and wide viewport sizes, with keyboard input and reduced motion enabled.

Notes

Interaction
Actions are buttons or links; the close button removes the alert after it folds.
Motion
A 0.28s entrance and a 0.26s fold on dismiss; none with reduced motion.
Accessibility
Danger uses role=alert so it's announced at once; the others use role=status. Each close button names the alert it closes, and after a dismissal keyboard focus moves to the neighbouring alert's close button. The mark is decorative; the tone is also in the title.
Responsive
Text wraps under the title; banner actions drop to their own line on narrow screens.
On touch
28px close targets inside a padded box; nothing relies on hover.

Featured

402 components