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

Komponenter

Komponenter

​
​

Inga resultat hittade, prova med andra sökvillkor.

Image

Image

2.3.2

A description of this component is work in progress.

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

Demo

Props

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

alt *

stringSpecifies an alternate text for an image. Use "" if image is decorative.

aspectRatio

numberOverride aspect ratio. Should be a ratio expressed as width divided by height, e.g. 3/2 or 1/1.

className

stringSpecifies additional CSS classes to be applied to the root element.

customAttribute

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

errorFallback

ElementSpecify a fallback to display if the image fails to load.

imageSx

SxPropsCustom styles to be applied to the image element.

isLoading

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

loadingFallback

ElementSpecify a fallback to display while the image is loading.

onError

(event: SyntheticEvent) => voidCallback function triggered when the image fails to load.

onLoad

(event: SyntheticEvent) => voidCallback function triggered when the image is successfully loaded.

rootSx

SxPropsCustom styles to be applied to the root container of the image.

src *

stringThe URL of the image to be displayed.

srcSet

stringSpecifies an optional 'srcset' attribute for the image element.

Installation

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

Länkar

  • Storybook

  • Figma

  • Bit.cloud

Best practices

Examples

Full width

Full width

Inline image

Inline

Tillgänglighet

Meningsbärande bilder måste alltid ha en alt-text som beskriver bildens innehåll för användare som inte ser den.

Change log

  • Adds new focus-visible markings.

    2.3.0
  • Scrollable container imported packages for sideeffects

    2.2.0
  • New ScrollableContainer

    2.2.0
  • Upgrade to React 19

    2.1.0

Statistik

  • Importer av Image

    1
  • Repos med Image

    5%
  • Senaste installerade version av Image

    4.3.1
  • Äldsta installerade version av Image

    4.3.1