Komponenter
List
Lister brukes til å presentere innhold på en kortfattet og oversiktlig måte, for eksempel for å oppsummere hovedpoengene i en tekst.
Egnet til:
- Oppsummere lengre tekster.
- Liste opp kriterier.
Uegnet til:
- Lengre innhold.
- Rikt innhold som bilder og video (det bryter opp flyten i en liste).
Eksempler
Retningslinjer
Det er ikke så mye å si om List, men hvis du har lyst til å lære mer om hvordan vi skriver lister i Nav kan du se Skriveregler i Nav.
Props
List
as?
- Type:"ul" | "ol"
- Default:"ul"
- Description:
HTML list element to render.
size?
- Type:"small" | "medium" | "large"
- Default:"medium"
- Description:
Changes margin-block on list and font size on items.
className?
- Type:string
ref?
- Type:Ref<HTMLDivElement>
- Description:
Allows getting a ref to the component instance. Once the component unmounts, React will set
ref.currenttonull(or call the ref withnullif you passed a callback ref). React Docs
title?
- Deprecated:Use <Heading> instead of `title`.
- Type:undefined
List.Item
children
- Type:ReactNode
- Description:
List item content.
title?
- Type:string
- Description:
List item title.
icon?
- Type:ReactNode
- Description:
Icon to be used instead of bullet (unordered lists only).
className?
- Type:string
ref?
- Type:Ref<HTMLLIElement>
- Description:
Allows getting a ref to the component instance. Once the component unmounts, React will set
ref.currenttonull(or call the ref withnullif you passed a callback ref). React Docs