Skip to content

Internal ID software / Surfaces

Card

A surface with a hairline border that knows nothing about what is in it.

Not drawn in Figma: built only from the tokens, for internal ID software. In code: components/software/card.tsx. From the old system: Card in @id-identity-as/ui.

Example

Eksempel 1001

Afventer godkendelse

Oprettet af Medarbejder A

12 linjer

padding lg

Eksempel 1001

Afventer godkendelse

Oprettet af Medarbejder A

12 linjer

padding lg

import { Card, CardHeader } from '@/components/software/card';

<Card>
  <CardHeader eyebrow="Ordre 41028" title="Afventer godkendelse" hint="Oprettet 28. august af Mette N." />
  <Text>2 linjer</Text>
</Card>

Props

PropTypeDefaultWhat it does
asElementType'section'The element to render. A card names a region of the page.
padding'md' | 'lg''md'Md is 20 px of padding, lg is 40 px.

Do

  • Let the border do the work. A page of bordered panels reads as order.
  • Give a card a CardHeader when it is a region of its own.

Do not

  • Do not add a shadow. There is none in the system.
  • Do not nest a card in a card. Use a hairline or a Stack inside.
  • Do not put a packshot in a card: packshots sit on Snow, in a ProductCard.

Accessibility

  • As a section it should be named: give it a CardHeader, or an aria-label through as and your own element.

Tokens it uses

  • color.surface.base
  • color.border.default
  • color.text.default
  • radius.sm
  • space.inline.5
  • space.section.1