# useRioCookieConsent

*Category:* Utilities
*Section:* Browser & device hooks
*Source:* https://uikit.developers.rio.cloud/#/utilities/useRioCookieConsent
*Captured:* 2026-04-27T14:59:40.030Z

The useRioCookieConsent hook reads and parses RIO's cookie_settings cookie and returns a typed consent state.

## useRioCookieConsent

### Example: Example 1

Check RIO cookie disclaimer status

#### React (tsx)

```tsx
import Button from '@rio-cloud/rio-uikit/Button';
import Notification from '@rio-cloud/rio-uikit/Notification';
import useRioCookieConsent from '@rio-cloud/rio-uikit/useRioCookieConsent';

export default () => {
    const { getRioCookieConsentInfo } = useRioCookieConsent();
    const isProd = import.meta.env.PROD;

    const handleShowRioCookieConsent = () => {
        const rioCookies = getRioCookieConsentInfo();

        Notification.info(
            <div>
                {!isProd && (
                    <div className='text-color-danger text-medium margin-bottom-10'>THIS ONLY WORKS IN PROD!</div>
                )}
                <ul className='space-y-5'>
                    <li>
                        UX cookie accepted: <b>{rioCookies.uxCookiesAccepted ? 'Yes' : 'No'}</b>
                    </li>
                    <li>
                        Marketing cookie accepted: <b>{rioCookies.marketingCookiesAccepted ? 'Yes' : 'No'}</b>
                    </li>
                    <li>
                        Status: <b>{rioCookies.status}</b>
                    </li>
                </ul>
            </div>
        );
    };

    return (
        <div>
            <Button onClick={handleShowRioCookieConsent}>Check RIO cookie disclaimer status</Button>
        </div>
    );
};
```

#### HTML (html)

```html
<div>
    <button type="button" class="btn btn-default btn-component" tabindex="0">Check RIO cookie disclaimer status</button>
</div>
```

#### Props: Return value

### Return value

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| getRioCookieConsentInfo | () => RioCookieConsentInfo | — | Reads and parses the RIO cookie consent settings. |

#### Props: RioCookieConsentInfo

### RioCookieConsentInfo

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| cookieName | 'cookie_settings' | — | Name of the RIO consent cookie. |
| isSet | boolean | — | Indicates whether the consent cookie exists. |
| rawValue | string | — | Raw cookie value as read from document.cookie. |
| parsedValue | Record<string, number> | — | Parsed and normalized cookie switches when JSON parsing succeeds. |
| uxCookiesAccepted | boolean | — | True when UX cookies are accepted (switch-49 === 1). |
| marketingCookiesAccepted | boolean | — | True when marketing cookies are accepted (switch-2 === 1). |
| status | RioCookieConsentStatus | — | Computed consent status derived from parsed cookie values. |