# Cookie consent

> The values of `data-action` inside `smootify-consent`.

Status: Ready (Smootify 2.0)  
URL: https://www.smootify.io/docs/reference/attributes/consent  
Updated: 2026-10-13

## At a glance

| State | Classes | The banner and the preferences button |
|---|---|---|
| The visitor has to answer | `is-required` on `smootify-consent`, `cookie-banner-visible` on the body | the banner shows; the preferences button is hidden |
| The preferences are open | `is-open` on `smootify-consent`, `cookie-banner-visible` on the body | `consent-panel="banner"` hides, `consent-panel="preferences"` shows |
| The visitor has answered | none | the banner is hidden; the preferences button shows and opens the preferences |
| No consent needed in the region | none | the banner never shows; the preferences button shows and opens the preferences, for example to refuse the sale of data |

More in [the guide](https://www.smootify.io/docs/features/cookie-consent).

## Where it can go

- **Inside** [`smootify-consent`](https://www.smootify.io/docs/reference/elements/smootify-consent).

## Values

| Attribute and value | What it is | Notes |
|---|---|---|
| `data-action="accept"` | Accept all | on button, link |
| `data-action="decline"` | Decline all | on button, link |
| `data-action="save"` | Save the choices | on button, link |
| `data-action="preferences"` | Open the preferences | on button, link |
| `data-action="close"` | Close | on button, link |
| `name="marketing"` | Marketing | A checkbox; on input |
| `name="analytics"` | Analytics | A checkbox; on input |
| `name="preferences"` | Preferences | A checkbox; on input |
| `name="sale_of_data"` | Sale of data | A checkbox; on input |
| `consent-panel="banner"` | Banner panel | on container |
| `consent-panel="preferences"` | Preferences panel | on container |
