# Types: ConsentCategory to ConsentToggleProps (/themes/sdk/reference/consent/types-1)

```ts
import { … } from '@poltura/theme-sdk/consent';
```

## `ConsentCategory` [#consentcategory]

A cookie category.

```ts
type ConsentCategory = 'necessary' | 'preferences' | 'analytics' | 'marketing'
```

The shopper can allow or refuse it; `necessary` is always allowed.

## `ConsentChoice` [#consentchoice]

A choice per category.

It covers every category the shopper can refuse.

<TypeTable type={{"preferences":{"description":"Whether functional cookies, such as live chat recognition and content caching, are allowed.","type":"boolean","required":true},"analytics":{"description":"Whether analytics and performance cookies are allowed.","type":"boolean","required":true},"marketing":{"description":"Whether marketing and advertising cookies are allowed.","type":"boolean","required":true}}} />

## `ConsentLink` [#consentlink]

A link the banner offers, such as the cookie policy.

<TypeTable type={{"label":{"description":"The link text in the page language.","type":"string","required":true},"href":{"description":"Where the link goes, already localised.","type":"string","required":true}}} />

## `ConsentCookieTableTexts` [#consentcookietabletexts]

A cookie table's headings.

<TypeTable type={{"name":{"description":"The cookie name column.","type":"string","required":true},"provider":{"description":"The column naming who sets the cookie.","type":"string","required":true},"purpose":{"description":"The column saying what the cookie is for.","type":"string","required":true},"expiry":{"description":"The column saying how long the cookie lasts.","type":"string","required":true}}} />

## `ConsentTexts` [#consenttexts]

The banner and panel texts.

Each is the merchant's wording where set, the store language's otherwise.

<TypeTable type={{"title":{"description":"The banner heading.","type":"string","required":true},"description":{"description":"The banner text under the heading.","type":"string","required":true},"acceptAll":{"description":"The button that allows every category.","type":"string","required":true},"rejectAll":{"description":"The button that allows only the necessary cookies.","type":"string","required":true},"openPreferences":{"description":"The link that opens the preferences, or an empty string when the merchant hides it.","type":"string","required":true},"preferencesTitle":{"description":"The preferences panel heading.","type":"string","required":true},"preferencesIntroTitle":{"description":"The heading of the panel's opening paragraph.","type":"string","required":true},"preferencesIntro":{"description":"The panel's opening paragraph.","type":"string","required":true},"save":{"description":"The button that saves the toggles as they stand.","type":"string","required":true},"close":{"description":"The accessible label of the panel's close button.","type":"string","required":true},"cookieTable":{"description":"The column headings of each category's cookie table.","type":"ConsentCookieTableTexts","required":true},"policyLink":{"description":"The cookie policy link.","type":"ConsentLink","required":true},"imprintLink":{"description":"The imprint link.","type":"ConsentLink","required":true}}} />

## `ConsentLayout` [#consentlayout]

The banner's shape.

```ts
type ConsentLayout = 'cloud' | 'box' | 'bar'
```

A floating cloud, a compact box or a full-width bar.

## `ConsentPosition` [#consentposition]

Where the banner sits.

```ts
type ConsentPosition = 'bottomCenter' | 'bottomLeft' | 'bottomRight' | 'topCenter' | 'topLeft' | 'topRight' | 'middleCenter'
```

A bar uses only the top or bottom half of it.

## `ConsentColors` [#consentcolors]

The banner's colours.

Each is a CSS colour or a design token reference such as `var(--card)`.

<TypeTable type={{"background":{"description":"The banner background.","type":"string","required":true},"text":{"description":"The heading and text colour.","type":"string","required":true},"buttonBackground":{"description":"The accept button's background.","type":"string","required":true},"buttonText":{"description":"The accept button's text.","type":"string","required":true},"secondaryButtonBackground":{"description":"The other buttons' background.","type":"string","required":true},"secondaryButtonText":{"description":"The other buttons' text.","type":"string","required":true}}} />

## `ConsentAppearance` [#consentappearance]

The banner's settings.

How the merchant set it up in the theme's cookie settings.

<TypeTable type={{"layout":{"description":"The banner's shape.","type":"ConsentLayout","required":true},"position":{"description":"Where the banner sits.","type":"ConsentPosition","required":true},"equalButtons":{"description":"Whether both choice buttons carry the same weight.","type":"boolean","required":true},"flipButtons":{"description":"Whether the choice buttons swap places.","type":"boolean","required":true},"showPreferences":{"description":"Whether the banner offers the preferences panel.","type":"boolean","required":true},"colors":{"description":"The colours in light mode.","type":"ConsentColors","required":true},"darkColors":{"description":"The colours in dark mode.","type":"ConsentColors","required":true}}} />

## `ConsentCookie` [#consentcookie]

A cookie the store may set, listed under its category in the preferences panel.

<TypeTable type={{"name":{"description":"The cookie's name or name pattern, such as `_ga, _ga_*`.","type":"string","required":true},"provider":{"description":"Who sets the cookie.","type":"string","required":true},"purpose":{"description":"What the cookie is for, in the page language.","type":"string","required":true},"expiry":{"description":"How long the cookie lasts, in the page language.","type":"string","required":true}}} />

## `ConsentCategoryInfo` [#consentcategoryinfo]

A category as listed.

The preferences panel lists it this way.

<TypeTable type={{"id":{"description":"The category.","type":"ConsentCategory","required":true},"label":{"description":"Its heading in the page language.","type":"string","required":true},"description":{"description":"What it covers, in the page language.","type":"string","required":true},"required":{"description":"Whether the shopper cannot refuse it; true only for `necessary`.","type":"boolean","required":true},"cookies":{"description":"The cookies it covers.","type":"readonly ConsentCookie[]","required":true}}} />

## `ConsentState` [#consentstate]

The shopper's consent, the banner's wording and look, and the actions that record a choice.

<TypeTable type={{"enabled":{"description":"Whether the store asks for consent at all; false when the merchant turned the banner off or no cookie in use needs it.","type":"boolean","required":true},"decided":{"description":"Whether the shopper has made a choice that is still stored.","type":"boolean","required":true},"granted":{"description":"What is allowed now, per category; `necessary` is always true.","type":"Readonly<Record<ConsentCategory, boolean>>","required":true},"acceptAll":{"description":"Allows every category and stores the choice.","type":"() => void","required":true},"rejectAll":{"description":"Allows only the necessary cookies and stores the choice.","type":"() => void","required":true},"save":{"description":"Stores a choice per category.","type":"(choice: ConsentChoice) => void","required":true},"preferencesOpen":{"description":"Whether the preferences panel is open.","type":"boolean","required":true},"openPreferences":{"description":"Opens the preferences panel.","type":"() => void","required":true},"closePreferences":{"description":"Closes the preferences panel without changing the choice.","type":"() => void","required":true},"texts":{"description":"Every text the banner and the panel show.","type":"ConsentTexts","required":true},"appearance":{"description":"How the merchant set the banner up.","type":"ConsentAppearance","required":true},"categories":{"description":"The categories in the order the panel lists them, `necessary` first.","type":"readonly ConsentCategoryInfo[]","required":true}}} />

## `ConsentBannerClassKey` [#consentbannerclasskey]

The banner's stylable parts.

```ts
type ConsentBannerClassKey = 'body' | 'texts' | 'title' | 'description' | 'buttons' | 'acceptAll' | 'rejectAll' | 'footer' | 'links'
```

The parts of [`ConsentBanner`](/themes/sdk/reference/consent/parts#consentbanner) a theme can add classes to.

## `ConsentBannerProps` [#consentbannerprops]

Props of [`ConsentBanner`](/themes/sdk/reference/consent/parts#consentbanner).

<TypeTable type={{"className":{"description":"Classes added to the banner.","type":"string","required":false},"classes":{"description":"Classes added to the banner's inner elements.","type":"Partial<Record<ConsentBannerClassKey, string>>","required":false}}} />

## `ConsentPreferencesClassKey` [#consentpreferencesclasskey]

The panel's stylable parts.

```ts
type ConsentPreferencesClassKey = 'overlay' | 'header' | 'title' | 'close' | 'body' | 'intro' | 'category' | 'categoryTitle' | 'categoryDescription' | 'table' | 'footer' | 'acceptAll' | 'rejectAll' | 'save'
```

The parts of [`ConsentPreferences`](/themes/sdk/reference/consent/parts#consentpreferences) a theme can add classes to.

## `ConsentPreferencesProps` [#consentpreferencesprops]

Props of [`ConsentPreferences`](/themes/sdk/reference/consent/parts#consentpreferences).

<TypeTable type={{"className":{"description":"Classes added to the panel.","type":"string","required":false},"classes":{"description":"Classes added to the panel's inner elements.","type":"Partial<Record<ConsentPreferencesClassKey, string>>","required":false}}} />

## `ConsentToggleProps` [#consenttoggleprops]

Props of [`ConsentToggle`](/themes/sdk/reference/consent/parts#consenttoggle).

<TypeTable type={{"category":{"description":"The category the switch allows or refuses.","type":"ConsentCategory","required":true},"className":{"description":"Classes added to the switch.","type":"string","required":false}}} />
