Consent Sheet

Pro

Privacy-first consent sheet for cookies, tracking and data sharing. Optional categories start off, Reject all sits as an equal beside Accept all, and per-category toggles let people choose what to allow.

Preview

Installation

npx @lumioui/cli add pro/consent-sheet

Usage

import { ConsentSheet } from "@/components/ui/consent-sheet/consent-sheet";
<ConsentSheet />

Examples

Single question

A travel planner asks one question: share anonymous crash and usage reports?

Cookie consent

A news app's first-launch privacy prompt over its front page.

Privacy settings

The same consent panel living inline on a sleep tracker's Privacy page.

API reference

Prop Type Default
open boolean

Controlled open state (sheet presentation).

—
defaultOpen boolean

Uncontrolled initial open state. Default false.

false
onOpenChange (open: boolean) => void

Fires when the sheet opens or closes.

—
presentation "sheet" | "inline"

"sheet" — modal bottom sheet. "inline" — the same panel embedded in a page (privacy settings), always expanded, never closes. Default "sheet".

"sheet"
title string

Heading. Default "Your privacy choices".

"Your privacy choices"
description string

Body copy under the heading.

—
categories ConsentCategory[]

Consent categories. Leave empty for a simple yes/no prompt.

[]
value ConsentChoices

Controlled choices (category id → granted).

—
defaultValue ConsentChoices

Uncontrolled initial choices. Default: required on, everything else off.

—
onValueChange (choices: ConsentChoices) => void

Fires on every switch flip.

—
onDecision
(choices: ConsentChoices … (choices: ConsentChoices, action: ConsentAction) => void

Fires once with the final choices when the person decides.

—
expanded boolean

Controlled "manage choices" expansion.

—
defaultExpanded boolean

Uncontrolled initial expansion. Default false.

false
onExpandedChange (expanded: boolean) => void

Fires when the category list unrolls or folds.

—
rejectLabel string

Labels.

"Reject all"
acceptLabel string "Accept all"
saveLabel string "Save choices"
manageLabel string "Manage choices"
requiredLabel string

Badge text on required rows. Default "Always on".

"Always on"
policyLabel string

Link under the body copy — "Privacy policy".

—
onPolicyPress () => void —
icon React.ComponentProps<typeof Icon>["name"]

Leading glyph in a tinted disc above the title.

—
dismissible boolean

Allow closing by backdrop tap / back button without a decision. Default false.

false
className string —