Skip to content

No.363 · 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. Shown as tinted boxes, hairline boxes, accent-barred notes and a full-width banner.

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: Light

Build an inline alert component in four tones and four looks. 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. Looks: soft is a 12px-radius box in the tone's tint with a 1px inset hairline in the tone, 14px padding (16px on the left); outline is a 12px-radius box in the page colour with the tone's 1px inset hairline and a barely-there shadow, the tone living only in the mark, the edge and the actions; accent bar is a box with a 3px inset bar in the tone down its left side (4px radius on the left, 12px on the right), filled with the tone's tint mixed 70% into the page, 18px left padding, no other edge; banner is a full-width strip at the top of the page, square, in the tone's tint with a hairline along the bottom, where the mark, title, sentence and actions sit on one line where they fit (actions pushed to the end, dropping to their own line on narrow screens), the close button at the far right, 10px vertical padding. Entering, an alert 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; keyboard focus moves to the neighbouring alert's close button. Show a section per look (soft with all four tones, outline with info and warning, accent bar with success and danger, one warning banner) on a #f7f7f6 / #0b0b0c page, with a way to bring dismissed ones back. Selected variant — Light (light): Palette for this theme (Light): --alrt-danger #c0161c; --alrt-danger-bg #fdeeee; --alrt-danger-line #f5c6c7; --alrt-focus #2563eb; --alrt-info #1d4fd8; --alrt-info-bg #eef3ff; --alrt-info-line #c9d8fd; --alrt-page #ffffff; --alrt-soft #4a4d55; --alrt-success #13703a; --alrt-success-bg #ebf7ef; --alrt-success-line #bfe3cb; --alrt-text #1d1e21; --alrt-warning #8a5900; --alrt-warning-bg #fdf5e1; --alrt-warning-line #f0d9a0. Treat these as the root colour tokens, one value per role, and name them to suit your code. Select it with the theme option set to "light". Keep every dimension, spacing value, state and motion from the brief unchanged, and keep text at 4.5:1 contrast or better on these surfaces. 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

425 components