Skip to content
satin

Notice

A banner or an alert inside the prompt bar, above the field: a new model, a tip or an outage.

Fable 5.2 available

Banner or alert

notice puts a message inside the bar, above the field: a Banner withlayout="inline" for something new, like a model to switch to, or an Alert withlayout="inline" for something people should know before they send. It sits 8px from the bar's edges, and the bar takes the 20px corner in either shape. Clear notice when it is dismissed.

Installation

Terminal
npm i @uisatin/ui
Import
import { Notice } from '@uisatin/ui/prompt-bar-notice'

About 65.2 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 notice is the notice prop on PromptBar: whatever it gets sits inside the bar, above the attachments and the field, 8px from the bar’s edges, and the bar takes radius 20 in either shape. Give it a Banner with layout="inline" (an icon, a title, one action, a close button) for something new, or an Alert with layout="inline" (intent sets the icon and the colour) for something to know before sending. Pass null once it is dismissed; if focus was in the notice, it moves to the field. Disabling the bar dims the bar, not the notice.

PropTypeDefault
notice
ReactNode
—
Banner.layout
"inline"
—
Banner.icon
ReactNode
—
Banner.title
string
—
Banner.action
ReactNode
—
Banner.onDismiss
() => void
—
Alert.layout
"inline"
—
Alert.intent
"neutral""info""success""warning""error"
"neutral"
Alert.title
ReactNode
—
Alert.onDismiss
() => void
—
className
string
—
ref
Ref<HTMLFormElement>
—
...props
ComponentProps<'form'>

Other attributes go to <form>

—

Accessibility

The notice is inside the bar’s form, before the field, so it comes first in reading and tab order. An Alert keeps its role: role="alert" for errors and warnings, read out when it appears, role="status" for the rest; a Banner has no role and isn’t read out on its own. Each close button is named "Dismiss". When the notice goes while focus is in it, focus moves to the "Message" field instead of dropping to the page.

KeyAction
EnterorSpaceOn the action or the close button: presses it.