Skip to content
satin

Announcement bar

One line of news across the top or bottom of the page, with a link and a close.

Fieldwork 4.0 is here: docs, plans, and cycles in one place

Installation

Terminal
npm i @uisatin/ui
Import
import { AnnouncementBar } from '@uisatin/ui/announcement-bar'

About 27.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 AnnouncementBar component is a full-width bar for one line of news across the top or bottom of the page, with a link to read more and an optional close.

PropTypeDefault
children
ReactNode
—
action
{ label, href?, onClick? }
—
onDismiss
() => void
—
dismissLabel
string
"Dismiss announcement"
tone
"primary""inverse""default"
"primary"
background
"plain""mesh"
"plain"
shimmer
boolean
false
sticky
"top""bottom"
—
className
string
—
ref
Ref<HTMLDivElement>
—
...props
ComponentProps<'div'>

Other attributes go to <div>

—

Accessibility

A region named "Announcement" (pass aria-label to change it). It is not a live region, so it is not read out when it appears. The close button is named "Dismiss announcement" (dismissLabel); an action with href renders as a link. The mesh images are hidden from screen readers.