• Start
  • Blogg
  • Kom igång
  • Riktlinjer
  • Komponenter
  • Changelog
  • Tillgänglighet
  • Statistik
  • Inställningar

Komponenter

Komponenter

​
​

Inga resultat hittade, prova med andra sökvillkor.

Price Object

Price Object

9.2.4

A description of this component is work in progress.

Demo
Props
Installation
Länkar
Tillgänglighet
Change log
Statistik

Demo

Props

Se fullständing dokumentation(öppnas i ny flik)
NamnTypBeskrivning

className

stringOptional CSS class name.

currency

"SEK" | "EUR"Currency of the price. Default is SEK.

customAttribute

{ attribute: string; value: string | number }Custom attribute for testing. Subcomponents will have this attribute suffixed with "-[ComponentName]".

disabled

booleanIf true, the component is disabled.

fontVariant

"h1" | "h2" | "h3" | "h4" | "subtitle1" | "body1" | "h1Small"Typography variant styling applied to the price text.

hidePricePrefix

booleanWhen true, hides the prefix that appears before the price.

leftAligned

booleanEnsures price alignment to the left on small or zoomed-in viewports.

locale

InputLanguageLocale setting for formatting the price and points.

pricePrefix

"from" | "add" | "addFrom"Text prefix displayed before the price.

priceType

"standard" | "textSecondary" | "lowPrice"Defines the color for the price.

sx

SxPropsCustom styles applied to the component.

useFontVariantOnBothPriceAndPoints

booleanWhen true, applies the fontVariant to both price and points. Defaults to false.

wrapPrefixAndPrice

booleanWraps the price prefix and the price into separate lines, useful for long prefixes.

Installation

Kodexempel
npm install @sj-ab/component-library.ui.price-object

Länkar

  • Storybook

  • Figma

  • Bit.cloud

Tillgänglighet

Anpassad uppläsning för skärmläsare

Price Object har inbyggt stöd för att förbättra uppläsningen av priser för gravt synskadade användare med skärmläsare.

Komponenten ersätter automatiskt den synliga texten med en lite mer utförlig text utan förkortningar:

  • "fr" läses upp som "Från"
  • "p" läses upp som "Poäng"
  • ":-" läses upp som "Svenska kronor"
  • etc

Detta görs genom att dölja den synliga texten med aria-hidden och lägga in dold text med <Typography variant="srOnly">

Alla utvecklare som uppdaterar PriceObject ansvarar för att också uppdatera uppläsningen!

Change log

  • Fix for priceObject for screen readers.

    9.2.2
  • Add support for EUR in PriceObject

    9.2.0
  • Upgrade to React 19

    9.1.0

Statistik

  • Importer av Price Object

    33
  • Repos med Price Object

    22%
  • Senaste installerade version av Price Object

    9.2.4
  • Äldsta installerade version av Price Object

    9.2.4