Magoo Component UI logo Magoo Component UI
← Catalog

Cookie Preferences

cookie-preferences organism experimental

A granular cookie-consent card with per-category toggle switches and Accept all / Reject all / Save controls.

The width preview needs a screen wider than the chosen width — use a larger device (or a desktop browser) to see the desktop and tablet layouts.

Default
AllOn

Props

NameTypeReq
title string
intro string
categories array ✓

Related components

How to use

Layout and the switch on/off appearance are pure CSS driven by each switch's data-state attribute (data-[state=true] on the track, group-data-[state=true] slides the knob), so the initial state renders with no JavaScript and shows in screenshots. behavior.js wires interaction: clicking a non-required switch flips its data-state and aria-checked; Accept all / Reject all set all toggles; Save reads every switch's aria-label and data-state and dispatches "cookies:save". The portable self-init reads everything from the markup and passes no props object.

Use cases

form-controlpanel WCAG AA SEO 20 dir: both ai-generated