Skip to content
satin

Alert

A message that stays on the page until it is dealt with: info, success, warning or error.

Two people are editing this page

Your changes merge when you save.

Installation

Terminal
npm i @uisatin/ui
Import
import { Alert } from '@uisatin/ui/alert'

About 15.6 kB of JavaScript, minified and gzipped, with what it imports (React aside). The stylesheet is one file for every component.

First time with Satin? Set it up once, styles and fonts included, with the installation guide.

API Reference

The Alert component is a div with role="alert" (errors and warnings) or role="status" that shows a status icon, a title, a description, an action and a close button.

PropTypeDefault
intent
"neutral""info""success""warning""error"
"neutral"
variant
"soft""outline"
"soft"
layout
"block""inline"
"block"
title
ReactNode
—
description
ReactNode
—
icon
booleanReactNode
true
action
ReactNode
—
onDismiss
() => void
—
className
string
—
ref
Ref<HTMLDivElement>
—
...props
ComponentProps<'div'>

Other attributes go to <div>

—

Accessibility

Errors and warnings are role="alert", so screen readers read them out when they appear; the other intents are role="status", read politely. The status icon is hidden, so say the severity in the title when it matters. The close button is named "Dismiss" (dismiss in SatinLabels).