We use cookies to improve this website
We’d like to use cookies to understand how people use this site and improve it. You can accept or reject them. Read our Privacy Policy.
Desktop
Bottom left of the page, 360px wide.
Official government website An official website of the Federal Government of Nigeria
How you knowAsks people to accept or reject non-essential cookies before anything is stored. It sits at the edge of the page without covering the task, and stays until people choose.
Updated
We’d like to use cookies to understand how people use this site and improve it. You can accept or reject them. Read ourPrivacy Policy.
Cookie banner
HTML
<section class="nds-cookie" aria-labelledby="cookie-title"> <div class="nds-cookie__frame"> <div class="nds-cookie__strip" aria-hidden="true"> </div> <div class="nds-cookie__panel"> <div class="nds-cookie__inner"> <div class="nds-cookie__content"> <h2 class="nds-cookie__title" id="cookie-title"> We use cookies to improve this website </h2> <p class="nds-cookie__message"> <span class="nds-cookie__message-lead"> We’d like to use cookies to understand how people use this site and improve it. You can accept or reject them. Read our </span> <a class="nds-link nds-link--md" href="/privacy"> Privacy Policy </a> <span class="nds-cookie__message-tail"> . </span> </p> </div> <div class="nds-cookie__actions"> <button type="button" class="nds-button nds-button--secondary nds-button--md"> Accept </button> <button type="button" class="nds-button nds-button--tertiary nds-button--md"> Reject </button> </div> </div> </div> </div></section> Block
<!-- wp:nds/cookie {} --><section class="nds-cookie" aria-labelledby="cookie-title"> <div class="nds-cookie__frame"> <div class="nds-cookie__strip" aria-hidden="true"> </div> <div class="nds-cookie__panel"> <div class="nds-cookie__inner"> <div class="nds-cookie__content"> <h2 class="nds-cookie__title" id="cookie-title"> We use cookies to improve this website </h2> <p class="nds-cookie__message"> <span class="nds-cookie__message-lead"> We’d like to use cookies to understand how people use this site and improve it. You can accept or reject them. Read our </span> <a class="nds-link nds-link--md" href="/privacy"> Privacy Policy </a> <span class="nds-cookie__message-tail"> . </span> </p> </div> <div class="nds-cookie__actions"> <button type="button" class="nds-button nds-button--secondary nds-button--md"> Accept </button> <button type="button" class="nds-button nds-button--tertiary nds-button--md"> Reject </button> </div> </div> </div> </div></section><!-- /wp:nds/cookie --> Usage
import { CookieBanner } from "@nigerian-design-standards/react";<CookieBanner privacyHref="/privacy"/> Show the cookie banner once per visitor, the first time they arrive, until they make a choice. It asks for a choice, so Accept and Reject are always both there.
The same component on every screen. Only its width and position change.
We’d like to use cookies to understand how people use this site and improve it. You can accept or reject them. Read our Privacy Policy.
Bottom left of the page, 360px wide.
We’d like to use cookies to understand how people use this site and improve it. You can accept or reject them. Read our Privacy
Fills the width between the 16px page margins, at the bottom.
The properties of the nds-cookie component. The same in HTML, WordPress and React.
| Property | Type | Possible values | Description |
|---|---|---|---|
| title | string |
| Optional. One line. Defaults to “We use cookies to improve this website”. |
| message | string |
| Optional. Two or three sentences: what is stored and why. Defaults to the standard wording. |
| privacyHref | string |
| Required. Where the Privacy Policy link goes. |
|
onAccept
onReject | function |
| Required. Store the choice, then remove the banner. Only Accept allows non-essential cookies. |
In code, the banner is a labelled region: <section aria-labelledby="cookie-title">. Don’t use aria-modal and
don’t trap focus. Accept and Reject are both <button type="button">, with the
same weight. Put the banner early in the page, after the skip link.
| Part | Token | Contrast on the page |
|---|---|---|
| Container | surface/canvas · border/subtle 1px (top, right, bottom) · radius/050 | Border is decorative |
| Strip (6px, top) | Naija Green (brand style, not a token yet) | 5.9:1 |
| Title | Label/large · text/primary | 17.6:1 |
| Message | Body/small · text/secondary | 6.6:1 |
| Privacy Policy link | status/info/surface, always underlined (like nds-link) | 5.6:1 |
| Accept · Reject | nds-button Secondary md · Tertiary md, 40px tall | See the Button page |
| Padding · gap | layout/card-padding 16px · spacing/150 12px between the buttons | — |
We’d like to use cookies to understand how people use this site and improve it. You can accept or reject them. Read our Privacy Policy.
Offer Accept and Reject together, with a link to the policy.
Our site enables script (e.g. cookies) that reads and stores information. By using our website, you’re agreeing to our Privacy Policy.
Don’t treat using the site as consent, or use jargon like “script”. Only a click on Accept counts.
Where the cookie banner sits and how it behaves.
How to write the cookie banner. Say what you store and why, in plain words, and offer a real choice.
“We’d like to use cookies to understand how people use this site and improve it.”
“You can accept or reject them.” Both buttons are on the first layer.
Never say that using or scrolling the site means people agree.
“Read our Privacy Policy.” The link goes to the full policy.
Say “cookies” and what they do, not “script that reads and writes information”.
A one-line title and two or three sentences.
| Write | Don’t write | Why |
|---|---|---|
| We’d like to use cookies to understand how people use this site | Our site enables script (e.g. cookies) that is able to read, store, and write information | Plain words. |
| You can accept or reject them | By using our website, you’re agreeing to the collection of data | Using the site isn’t consent. |
| Read our Privacy Policy | Click here | The link says where it goes. |
| Accept · Reject | OK · More options | Two clear, equal choices. |
| Reject | Not now | Says what happens. |
The banner has to be reachable without a mouse, and it must never trap anyone.
| Key | What it does |
|---|---|
| Tab | Moves to the Privacy Policy link, then Accept, then Reject, then on into the page. |
| Shift + Tab | Moves back. |
| Enter or Space | On a button, records the choice and closes the banner. Enter on the link opens the policy. |
Copy the code for HTML, WordPress or React from the Code tab in Live example. The options are listed under Specifications.
Use nds-cookie from 01 Library – Foundations. Change only the title and message text. Don’t detach it.
Is this page useful?