An interactive cookie notice with four hairline categories on live switches, a locked required group, save and reject-all actions, and a scrollable table naming every cookie, its purpose, and its retention.
An interactive cookie notice with four hairline categories on live switches, a locked required group, save and reject-all actions, and a scrollable table naming every cookie, its purpose and its retention.
Upgrade to Pro
Pro blocks install through the shadcn CLI with your license key and ship their full source. Docs and live previews stay open to everyone, so you can read every block's details first.
Swap YOUR_EMAIL and YOUR_KEY for the email and license key on your account. Find your license key on your account page.
Radix flavor
npx shadcn add "https://ui.beste.co/r/legal57?email=YOUR_EMAIL&license_key=YOUR_KEY"Base UI flavor
npx shadcn add "https://ui.beste.co/r-base/legal57?email=YOUR_EMAIL&license_key=YOUR_KEY"This installs the block to components/beste/block/legal57.tsx, the shadcn/ui switch component it depends on, and the badge23 and button21 components it uses for the eyebrow and the actions.
The installed file exports legal57Demo alongside the block: the exact props behind the preview above. Spread it to get a working preference centre in one line.
import { Legal57, legal57Demo } from "@/components/beste/block/legal57";
export default function CookiesPage() {
return <Legal57 {...legal57Demo} />;
}Then replace the demo with your own props. Written out, a trimmed setup looks like this:
import { Legal57 } from "@/components/beste/block/legal57";
export default function CookiesPage() {
return (
<Legal57
badge={{ label: "Cookie preferences" }}
heading="Choose what we are allowed to remember"
description="Only the first group is required for the product to work."
categories={[
{
name: "Strictly necessary",
description: "Keeps you signed in. Cannot be switched off.",
locked: true,
defaultOn: true,
},
{
name: "Analytics",
description: "Counts which screens get used, aggregated and never linked to a record.",
defaultOn: false,
},
]}
acceptLabel="Save preferences"
rejectLabel="Reject everything optional"
finePrint="Your choice is stored for twelve months."
tableTitle="Every cookie we set"
columns={["Cookie", "Set by", "Purpose", "Kept for"]}
rows={[
{
name: "sir_session",
provider: "Sirius",
purpose: "Keeps you signed in between page loads",
retention: "Session",
},
]}
/>
);
}| Prop | Type | Default | Description |
|---|---|---|---|
badge | { label: string } | – | Eyebrow above the heading, rendered through Badge23 |
heading | string | – | Section heading, capped at max-w-2xl |
description | string | – | Supporting paragraph, capped at max-w-xl |
categories | CookieCategory[] | [] | Toggleable groups, with the required one locked |
acceptLabel | string | – | Label for the save action |
rejectLabel | string | – | Label for the reject-all action |
finePrint | string | – | Storage note beside the actions |
tableTitle | string | – | Small label above the cookie table |
columns | string[] | [] | Table column headings |
rows | CookieRow[] | [] | Every cookie the site sets |
className | string | – | Extra classes for the outer section |
type CookieCategory = {
name: string;
description: string;
locked?: boolean;
defaultOn?: boolean;
};
type CookieRow = {
name: string;
provider: string;
purpose: string;
retention: string;
};locked || Boolean(defaultOn), so a locked category is always on regardless of what defaultOn says.disabled switch and drop their cursor-pointer, so the control looks and behaves as unavailable rather than silently ignoring clicks.htmlFor and a generated id, so clicking the name toggles the group.Button21 elements with no handlers. Nothing is persisted, and no cookie is actually written, so wiring consent storage is yours.font-mono, which is the one deliberate monospace use here: a cookie key is an identifier to be matched character by character. The th also carries font-normal, since a th inherits bold from the browser default and Tailwind's Preflight does not reset it.min-w-[40rem] inside an overflow-x-auto wrapper, so it scrolls on small screens rather than compressing four columns.last:border-b, so the group list reads as a table rather than trailing off into the actions.legal6
Displays cookie categories with toggle switches to manage consent preferences. Perfect for allowing users to customize their privacy settings granularly.
legal16
Explains cookie types (essential, functional, analytics, marketing) with icons and examples. Perfect for cookie policy pages educating users on tracking technologies.
legal44
Cookie policy card listing each cookie type with name, description, and required/optional badge. Suitable for dedicated cookie policy pages or modals.
legal1
Displays a cookie notification with accept, reject, and customize buttons. Perfect for GDPR-compliant websites requiring user consent.