Ticket Card

4.4.21

A description of this component is work in progress.

Demo

NamnTypBeskrivning

cardName *

stringThe display name of the card.

cardNameComponent

unknownDefines the semantic HTML element to be used for the cardName typography of the card. Default is H3

clickableCardScreenReaderPrefix

stringVisually hidden prefix text for screen readers. Used only when card is clickable. Should clarify the action, e.g. "Show QR code for".

customAttribute

{ attribute: string; value: string | number }Used for tests. Clickable and requested subcomponents will be suffixed with "-[ComponentName]".

customTranslation

DeepPartialTranslation object used for screen reader texts.

isLoading

booleanIf true, a loading skeleton will be rendered instead of the component.

lang

"sv" | "en"Language used for internal translations.

layout

"small" | "medium"Fixed size of the card, takes precedence over breakpoints.

onClick

() => voidCallback when card is clicked, also adds clickable card styling.

resplusLogo

booleanIndicates if the ResPlus logo should be displayed. Only applicable for yearCardSilver or yearCardGold variants.

showQrCode

booleanIndicates whether a QR code logo should be displayed on the card, suggesting the presence of a scannable QR code.

showValidityDates

booleanDetermines whether the card's validity period (validityFrom and validityTo) is displayed. Defaults to true.

status

"CANCELLED" | "EXHAUSTED" | "EXPIRED" | "PARTIALLY_CREDITED"Status of the card: CANCELLED, EXHAUSTED, EXPIRED, or PARTIALLY_CREDITED

Installation

npm install @sj-ab/component-library.ui.ticket-card

Länkar

Best practices

Variant

SJ Default Card

Movingo

Movingo

Year Card Silver

Year Card Silver

Year Card Gold

Year Card Gold

Examples

Example 1

Example 1

Example 2

Example 2

Change log

Statistik

  • Importer av Ticket Card

    4
  • Repos med Ticket Card

    15%
  • Senaste installerade version av Ticket Card

    4.4.16
  • Äldsta installerade version av Ticket Card

    4.4.16