Skip to content
Vy logo
  • Identitet
  • Spor
  • Resources
Components

Image

GitHub

Code examples

<Image src='https://www.vy.no/images/eyx1eny7/~alias-vyno-production/0a8e8e09b2c02a7a2261e98a77e54638011c07bb-7512x4984.tif?rect=0,469,7512,4226&w=1175&h=661&q=60&fit=crop&auto=format' alt='Bilde av tog som kjører gjennom snøfylt landskap' />

Guidelines

When you use Image, you must always include the alt attribute with a short, descriptive text for accessibility. Decorative images may have an empty alt text, but the attribute must still be present.

Use src to specify the image file. Set boxSize for sizing, or use CSS for responsive design. Avoid using Image for plain text or important visual elements.

Code

<Image />

import { Image } from "@vygruppen/spor-react";

Props

Name
Type
Required?
Description
srcstringPath til bilde
altstringAlternativ tekst hvis bildet ikke kan vises. Også viktig for skjermlesere og SEO