Skip to content

Commit f55e882

Browse files
mrosvikfrankdahleIldestmagnusrandmimarz
authored
docs: article about consent banner (#4938)
Co-authored-by: Frank Dahle <frankdahle@gmail.com> Co-authored-by: Gørild Døhl <gorild.dohl@digdir.no> Co-authored-by: Magnus Rand <magnus.rand@entur.org> Co-authored-by: Michael Marszalek <mimarz@gmail.com>
1 parent 6aa7888 commit f55e882

14 files changed

Lines changed: 610 additions & 44 deletions

apps/www/app/_components/avatar-stack/avatar-stack.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,15 @@ const avatarMap = {
1212
brønnøysundregistrene: 'brønnøysundregistrene.svg',
1313
digdir: 'digdir.svg',
1414
designsystemet: 'designsystemet.svg',
15+
entur: 'entur.svg',
16+
helsedirektoratet: 'helsedirektoratet.svg',
1517
'ks digital': 'ksdigital.svg',
1618
ks: 'ks.png',
1719
mattilsynet: 'mattilsynet.svg',
1820
nav: 'nav.svg',
21+
nrk: 'nrk.svg',
1922
'oslo kommune': 'oslokommune.svg',
23+
politiet: 'politiet.svg',
2024
skatteetaten: 'skatteetaten.svg',
2125
} as const;
2226

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,12 @@
11
---
2-
title: Consent banner
3-
sidebar_title: Consent banner
4-
category: Upcoming patterns
5-
description: How can we ensure a holistic and accessible approach to managing consent for cookies and tracking technologies?
6-
partners: Digdir, Nav, Skatteetaten ++
2+
title: Ask users for consent to store information
3+
sidebar_title: Consent to store information
4+
category: Ask users for...
5+
description: How to create a consent banner that is understandable, accessible, and gives users genuine choices.
6+
partners: Digdir, Nav, The Norwegian Tax Administration, Oslo Municipality, Entur, The Police, The Brønnøysund Register Centre, The Norwegian Directorate of Health, NRK
77
search_terms: consent banner, cookie banner, cookies, consent, privacy
8-
date: 2026-02-16
8+
date: 2026-06-29
99
order: 75
1010
---
1111

12-
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.
13-
14-
A shared pattern for consent banners can contribute to:
15-
16-
- A more consistent and recognisable user experience
17-
- Equal presentation of choices, without manipulative design
18-
- Improved accessibility and inclusive design
19-
- Clearer distinction between necessary and optional technologies
20-
- A shared understanding of recommended interaction and behaviour
21-
22-
<Card
23-
data-color='warning'
24-
variant="tinted"
25-
>
26-
**Work in progress** \
27-
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/2977).
28-
29-
</Card>
12+
This article has not yet been translated into English. You can read the Norwegian version here: [Be brukerne om samtykke til å lagre informasjon](/no/patterns/consent-banner)
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import {
2+
Button,
3+
Checkbox,
4+
Divider,
5+
Fieldset,
6+
Link,
7+
Paragraph,
8+
useCheckboxGroup,
9+
} from '@digdir/designsystemet-react';
10+
11+
export const DontNegations = () => {
12+
return (
13+
<Paragraph>
14+
Ønsker du at vi ikke skal lagre informasjon om deg og dine bruksmønstre?
15+
</Paragraph>
16+
);
17+
};
18+
19+
export const DoNegations = () => {
20+
return (
21+
<Paragraph>Får vi samle informasjon om hvordan nettsiden brukes?</Paragraph>
22+
);
23+
};
24+
25+
export const DontButtons1 = () => {
26+
return (
27+
<>
28+
<Button variant='primary'>Nei, jeg vil ikke ha en bedre tjeneste</Button>
29+
<Button variant='primary'>Ja, jeg vil hjelpe til</Button>
30+
<Button variant='primary'>Godta anbefalte</Button>
31+
<Button variant='primary'>OK</Button>
32+
<Button variant='primary'>Jeg forstår</Button>
33+
</>
34+
);
35+
};
36+
37+
export const DoButtons1 = () => {
38+
return (
39+
<>
40+
<Button variant='primary'>Ja</Button>
41+
<Button variant='primary'>Nei</Button>
42+
<Divider />
43+
<Button variant='primary'>Godta</Button>
44+
<Button variant='primary'>Avslå</Button>
45+
</>
46+
);
47+
};
48+
49+
export const DontButtons2 = () => {
50+
return <Button variant='primary'>Godta bare nødvendige</Button>;
51+
};
52+
53+
export const DoButtons2 = () => {
54+
return (
55+
<>
56+
<Button variant='primary'>Ja</Button>
57+
<Button variant='primary'>Nei</Button>
58+
</>
59+
);
60+
};
61+
62+
export const DontNecessaryCookiesCheckbox = () => {
63+
const { getCheckboxProps } = useCheckboxGroup({
64+
value: ['necessary'],
65+
});
66+
67+
return (
68+
<Fieldset>
69+
<Fieldset.Legend>Hvilken informasjon kan vi lagre?</Fieldset.Legend>
70+
<Checkbox
71+
label='Nødvendige informasjonskapsler'
72+
{...getCheckboxProps({
73+
disabled: true,
74+
value: 'necessary',
75+
})}
76+
/>
77+
<Checkbox label='Statistikk om hvordan nettsiden brukes' />
78+
</Fieldset>
79+
);
80+
};
81+
82+
export const DoNecessaryCookiesCheckbox = () => {
83+
return (
84+
<Paragraph>
85+
<Link href='#nodvendig-informasjon' style={{ color: 'inherit' }}>
86+
Vi lagrer også nødvendig informasjon
87+
</Link>{' '}
88+
som ikke kan velges bort. Dette gjør at nettsiden fungerer og er trygg.
89+
</Paragraph>
90+
);
91+
};

0 commit comments

Comments
 (0)