Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
fde17a3
Update consent-banner.mdx
frankdahle Jun 2, 2026
e00db75
titles and lists
mrosvik Jun 2, 2026
090292f
code
mrosvik Jun 2, 2026
2545d44
Made the language more active
mrosvik Jun 2, 2026
b019564
added images and clearified placement together with skiplink
mrosvik Jun 2, 2026
2f1a1f0
add examples
mrosvik Jun 3, 2026
ae90197
improve alt texts, fix typos, add contributors
mrosvik Jun 3, 2026
bec0e26
add do dont examples
mrosvik Jun 3, 2026
6e68292
removed repetitions
mrosvik Jun 3, 2026
f8cb646
Merge branch 'main' into Cookie-banner
mrosvik Jun 3, 2026
db59a8d
examples
mrosvik Jun 3, 2026
6d0c139
Merge branch 'Cookie-banner' of https://github.com/digdir/designsyste…
mrosvik Jun 3, 2026
287c5dc
new image as suggested by @magnusrand
mrosvik Jun 3, 2026
1f98399
remove duplicated button
mrosvik Jun 3, 2026
4c61e10
add disclamer
mrosvik Jun 3, 2026
c696231
add disclamer and a new story
mrosvik Jun 3, 2026
6a844f0
Refine wording
mrosvik Jun 3, 2026
8dd4e72
move technology-neutral consent guidance earlier
mrosvik Jun 3, 2026
0116574
Removed unused link
mrosvik Jun 3, 2026
749d982
fix some sentences
mrosvik Jun 3, 2026
f3e4cd0
Feedback from @dortedrange
mrosvik Jun 4, 2026
f646825
changed the title since it is not only about how the website is used.
mrosvik Jun 4, 2026
6f16b99
removed duplicate sentence
mrosvik Jun 4, 2026
eb99a5b
new image for video
mrosvik Jun 4, 2026
452d6db
simplified the sentence for updating consent
mrosvik Jun 4, 2026
c7f0077
remove title
mrosvik Jun 4, 2026
96315a0
merged two paragraphs
mrosvik Jun 4, 2026
00385a8
shortened the preparations chapter.
mrosvik Jun 4, 2026
7a3e542
the article has not yet been translated into English
mrosvik Jun 4, 2026
c5c20d1
fix sentence
mrosvik Jun 4, 2026
1d759c1
combine paragraphs
mrosvik Jun 4, 2026
4946822
as suggested by @Febakke
mrosvik Jun 4, 2026
9fa7ed8
add space
mrosvik Jun 4, 2026
fdaf4b5
specify bottom at page
mrosvik Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 7 additions & 24 deletions apps/www/app/content/patterns/en/consent-banner.mdx
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
---
title: Consent banner
sidebar_title: Consent banner
category: Upcoming patterns
description: How can we ensure a holistic and accessible approach to managing consent for cookies and tracking technologies?
partners: Digdir, Nav, Skatteetaten ++
title: Ask users for consent to store information
sidebar_title: Consent to store information
category: Ask users for...
description: How to create a consent banner that is understandable, accessible, and gives users genuine choices.
partners: Digdir, Oslo municipality, NAV, The Norwegian Tax Administration, Entur ++
search_terms: consent banner, cookie banner, cookies, consent, privacy
date: 2026-02-16
date: 2026-06-02
order: 75
---

A consent banner should give users genuine control over their own data. At the same time, it must be clear, understandable and accessible to everyone. Today, this is handled differently across public services, both in terms of language, design, equal presentation of choices and technical implementation.

A shared pattern for consent banners can contribute to:

- A more consistent and recognisable user experience
- Equal presentation of choices, without manipulative design
- Improved accessibility and inclusive design
- Clearer distinction between necessary and optional technologies
- A shared understanding of recommended interaction and behaviour

<Card
data-color='warning'
variant="tinted"
>
**Work in progress** \
A cross-agency working group is developing common guidelines and recommendations for this topic during spring 2026. We greatly appreciate input from anyone with relevant experience, insights or results from user testing. You are welcome to contribute in the related [GitHub discussion thread](https://github.com/digdir/designsystemet/discussions/1671).

</Card>
The article has not yet been translated into English, but you can view the Norwegian version here: [Consent banner (Norwegian)](/no/patterns/consent-banner)
42 changes: 42 additions & 0 deletions apps/www/app/content/patterns/no/consent-banner.dodont.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import { Button, Checkbox, Paragraph } from '@digdir/designsystemet-react';

export const DontNegations = () => {
return (
<Paragraph>
Ønsker du at vi ikke skal lagre informasjon om deg og dine bruksmønstre?
</Paragraph>
);
};

export const DoNegations = () => {
return (
<Paragraph>Får vi samle informasjon om hvordan nettsiden brukes?</Paragraph>
);
};

export const DontButtons1 = () => {
return (
<>
<Button variant='primary'>Nei, jeg vil ikke ha en bedre tjeneste</Button>
<Button variant='primary'>Ja, jeg vil hjelpe til</Button>
<Button variant='primary'>Godta anbefalte</Button>
<Button variant='primary'>OK</Button>
<Button variant='primary'>Jeg forstår</Button>
</>
);
};

export const DontButtons2 = () => {
return <Button variant='primary'>Godta bare nødvendige</Button>;
};

export const DontNecessaryCookiesCheckbox = () => {
return (
<Checkbox
checked
disabled
label='Nødvendige informasjonskapsler'
readOnly
/>
);
};
235 changes: 215 additions & 20 deletions apps/www/app/content/patterns/no/consent-banner.mdx

Large diffs are not rendered by default.

106 changes: 106 additions & 0 deletions apps/www/app/content/patterns/no/consent-banner.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import {
Button,
Heading,
Link,
Paragraph,
SkipLink,
} from '@digdir/designsystemet-react';

export const ConsentBanner = () => {
return (
<>
<section
aria-labelledby='samtykkebanner__tittel'
style={{
background: '#0062ba',
color: 'white',
padding: 'var(--ds-size-8) var(--ds-size-8)',
}}
>
<Heading
id='samtykkebanner__tittel'
data-size='md'
style={{ marginBottom: 'var(--ds-size-4)' }}
>
Får vi samle informasjon om hvordan nettsiden brukes?
</Heading>
<Paragraph
style={{
color: 'inherit',
fontSize: '1.25rem',
maxWidth: '68rem',
}}
>
Hvis du svarer ja, lagrer og analyserer vi informasjon som hjelper oss
å forbedre nettsiden. Du kan når som helst endre valget ditt nederst
på siden.{' '}
<Link href='#mer-om-hva-vi-lagrer' style={{ color: 'inherit' }}>
Mer om hva vi lagrer og hvorfor.
</Link>
</Paragraph>
<form
method='post'
action='/api/consent'
style={{
display: 'flex',
gap: 'var(--ds-size-4)',
marginTop: 'var(--ds-size-5)',
}}
>
<Button
className='consent-banner-button'
data-color='neutral'
data-size='md'
name='action'
type='submit'
value='all'
>
Ja
</Button>
<Button
className='consent-banner-button'
data-color='neutral'
data-size='md'
name='action'
type='submit'
value='required'
>
Nei
</Button>
</form>
<Paragraph
style={{
color: 'inherit',
fontSize: '1.125rem',
marginTop: 'var(--ds-size-8)',
}}
>
<Link href='#nodvendig-informasjon' style={{ color: 'inherit' }}>
Vi lagrer også nødvendig informasjon
</Link>{' '}
som ikke kan velges bort. Dette gjør at nettsiden fungerer og er
trygg.
</Paragraph>
</section>
<style>
{`
.consent-banner-button {
background-color: rgb(255 255 255 / 100%);
color: rgb(0 0 0 / 100%);
}

.consent-banner-button:hover {
background-color: rgb(255 255 255 / 70%);
}

.consent-banner-skip-link:focus {
width: 100%;
}
`}
</style>
<SkipLink className='consent-banner-skip-link' href='#main'>
Hopp til hovedinnhold
</SkipLink>
</>
);
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading