Skip to content
satin

Cookie consent

Asks once what the site may store: Customize, Reject all or Accept all.

We use essential cookies to run this site. With your OK, we'd also use optional ones to remember settings and learn what helps.

Installation

Terminal
npm i @uisatin/ui
Import
import { CookieConsent } from '@uisatin/ui/cookie-consent'

About 15.0 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 CookieConsent component is a card that asks what the site may store: the message, then Customize, Reject all and Accept all. It is a labelled region, not a modal.

PropTypeDefault
children
ReactNode
—
onAccept
() => void
—
onReject
() => void
—
onCustomize
() => void
—
acceptLabel
string
"Accept all"
rejectLabel
string
"Reject all"
customizeLabel
string
"Customize"
floating
boolean
false
className
string
—
ref
Ref<HTMLElement>
—
...props
ComponentProps<'section'>

Other attributes go to <section>

—

Accessibility

A section named "Cookie consent" (aria-label overrides it), so it is a region landmark. It is not a modal and not a live region: focus stays where it was and the page stays usable. The answers are native buttons.