No Preview

Sorry, but you either have no stories or none are selected somehow.

If the problem persists, check the browser console, or the terminal you've run Storybook from.

Image

Use this component to display an image.

usage
import { Image, SvgImage } from "@sharegate/orbit-ui";
sources
Github

Guidelines

Accessibility

  • An image must have an alt attribute.
  • If the image does not add more information to the existing context(decorative), use alt="".

Usage

Shape

An image can use a different shape.

GalaxyGalaxy
Editable example

Size

An image size can be specifyied with the width and height props.

Galaxy
Editable example

Retina

You can let the browser decide which image is best to serve according to the user device screen pixel density.

It is highly recommended to serve a 1x image as well as a 2x image, twice the intended size. This assures the user has the best looking image possible.

Avoid serving images that are unecessary big, images should be resized to the intended final image display size. This assures we don't waste bandwith for the user.

Galaxy
Editable example

SvgImage

For some use cases, like dark mode support, an SVG image is a better fit than a standard PNG or JPG image. Orbit provide a component for these images which will take care for you of the accessibility attributes and enforce a mandatory aria-label attribute.

Editable example

Size

An SVG image size can be specified with the width and height props.

Editable example

Color

An SVG image stroke and fill color can vary.

Editable example

API

Image

usage
import { Image } from "@sharegate/orbit-ui";
NameDescriptionDefault
height
The image height.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "fit-content" | "max-content" | "min-content" | "-moz-max-content" | "-moz-min-content" | 15 | 16 | 17 | 18 | "-webkit-fit-content" | ResponsiveValue<HeightValue>
-
objectFit
See MDN.
"fill" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "none" | "contain" | "cover" | "scale-down" | ResponsiveValue<ObjectFit>
-
objectPosition
See MDN.
0 | "center" | "bottom" | "left" | "right" | "top" | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | ResponsiveValue<ObjectPosition<0 | (string & {})>>
-
shape
The image shape.
"circular""rounded""straight"
"straight"
slot
Slot to render into.
string
-
src
An image path.
string | ResponsiveValue<string>
-
width
The image width.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "fit-content" | "max-content" | "min-content" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | 15 | 16 | 17 | 18 | "-webkit-fit-content" | "-webkit-max-content" | "intrinsic" | "min-intrinsic" | ResponsiveValue<WidthValue>
-

SvgImage

usage
import { SvgImage } from "@sharegate/orbit-ui";
NameDescriptionDefault
aria-label*
See WCAG.
string
-
fill
See MDN.
"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "alias-static-white" | "alias-accent" | "alias-accent-hover" | "alias-accent-active" | "alias-alert" | "alias-alert-hover" | "alias-warning" | "alias-success" | "white" | "black" | "gray" | "purple-1" | "purple-2" | "purple-3" | "purple-4" | "purple-5" | "purple-6" | "purple-7" | "purple-8" | "purple-9" | "purple-10" | "orange-1" | "orange-2" | "orange-3" | "orange-4" | "orange-5" | "orange-6" | "orange-7" | "orange-8" | "orange-9" | "orange-10" | "green-1" | "green-2" | "green-3" | "green-4" | "green-5" | "green-6" | "green-7" | "green-8" | "green-9" | "green-10" | "alert-1" | "alert-2" | "alert-3" | "alert-4" | "alert-5" | "alert-6" | "alert-7" | "alert-8" | "alert-9" | "alert-10" | "warning-1" | "warning-2" | "warning-3" | "warning-4" | "warning-5" | "warning-6" | "warning-7" | "warning-8" | "warning-9" | "warning-10" | "success-1" | "success-2" | "success-3" | "success-4" | "success-5" | "success-6" | "success-7" | "success-8" | "success-9" | "success-10" | "neutral-1" | "neutral-2" | "neutral-3" | "neutral-4" | "neutral-5" | "neutral-6" | "neutral-7" | "neutral-8" | "neutral-9" | "neutral-10" | "accent-1" | "accent-2" | "accent-3" | "accent-4" | "accent-5" | "accent-6" | "accent-7" | "accent-8" | "accent-9" | "accent-10" | "none" | "alias-primary" | "alias-primary-hover" | "alias-secondary" | "alias-tertiary" | "alias-faint" | "alias-input-placeholder" | "child" | "context-fill" | "context-stroke" | ResponsiveValue<FillValue>
-
height
The image height.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "fit-content" | "max-content" | "min-content" | "-moz-max-content" | "-moz-min-content" | 15 | 16 | 17 | 18 | "-webkit-fit-content" | ResponsiveValue<HeightValue>
-
slot
Slot to render into.
string
-
src
An SVG as a component.
"symbol" | "object" | "a" | "abbr" | "address" | "area" | "article" | "aside" | "audio" | "b" | "base" | "bdi" | "bdo" | "big" | "blockquote" | "body" | "br" | "button" | "canvas" | "caption" | "center" | "cite" | "code" | "col" | "colgroup" | "data" | "datalist" | "dd" | "del" | "details" | "dfn" | "dialog" | "div" | "dl" | "dt" | "em" | "embed" | "fieldset" | "figcaption" | "figure" | "footer" | "form" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "head" | "header" | "hgroup" | "hr" | "html" | "i" | "iframe" | "img" | "input" | "ins" | "kbd" | "keygen" | "label" | "legend" | "li" | "link" | "main" | "map" | "mark" | "menu" | "menuitem" | "meta" | "meter" | "nav" | "noindex" | "noscript" | "ol" | "optgroup" | "option" | "output" | "p" | "param" | "picture" | "pre" | "progress" | "q" | "rp" | "rt" | "ruby" | "s" | "samp" | "slot" | "script" | "section" | "select" | "small" | "source" | "span" | "strong" | "style" | "sub" | "summary" | "sup" | "table" | "template" | "tbody" | "td" | "textarea" | "tfoot" | "th" | "thead" | "time" | "title" | "tr" | "track" | "u" | "ul" | "var" | "video" | "wbr" | "webview" | "svg" | "animate" | "animateMotion" | "animateTransform" | "circle" | "clipPath" | "defs" | "desc" | "ellipse" | "feBlend" | "feColorMatrix" | "feComponentTransfer" | "feComposite" | "feConvolveMatrix" | "feDiffuseLighting" | "feDisplacementMap" | "feDistantLight" | "feDropShadow" | "feFlood" | "feFuncA" | "feFuncB" | "feFuncG" | "feFuncR" | "feGaussianBlur" | "feImage" | "feMerge" | "feMergeNode" | "feMorphology" | "feOffset" | "fePointLight" | "feSpecularLighting" | "feSpotLight" | "feTile" | "feTurbulence" | "filter" | "foreignObject" | "g" | "image" | "line" | "linearGradient" | "marker" | "mask" | "metadata" | "mpath" | "path" | "pattern" | "polygon" | "polyline" | "radialGradient" | "rect" | "stop" | "switch" | "text" | "textPath" | "tspan" | "use" | "view" | ComponentClass<any, any> | FunctionComponent<any> | ResponsiveValue<ElementType<any>>
-
stroke
See MDN.
"-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "alias-static-white" | "alias-accent" | "alias-accent-hover" | "alias-accent-active" | "alias-alert" | "alias-alert-hover" | "alias-warning" | "alias-success" | "white" | "black" | "gray" | "purple-1" | "purple-2" | "purple-3" | "purple-4" | "purple-5" | "purple-6" | "purple-7" | "purple-8" | "purple-9" | "purple-10" | "orange-1" | "orange-2" | "orange-3" | "orange-4" | "orange-5" | "orange-6" | "orange-7" | "orange-8" | "orange-9" | "orange-10" | "green-1" | "green-2" | "green-3" | "green-4" | "green-5" | "green-6" | "green-7" | "green-8" | "green-9" | "green-10" | "alert-1" | "alert-2" | "alert-3" | "alert-4" | "alert-5" | "alert-6" | "alert-7" | "alert-8" | "alert-9" | "alert-10" | "warning-1" | "warning-2" | "warning-3" | "warning-4" | "warning-5" | "warning-6" | "warning-7" | "warning-8" | "warning-9" | "warning-10" | "success-1" | "success-2" | "success-3" | "success-4" | "success-5" | "success-6" | "success-7" | "success-8" | "success-9" | "success-10" | "neutral-1" | "neutral-2" | "neutral-3" | "neutral-4" | "neutral-5" | "neutral-6" | "neutral-7" | "neutral-8" | "neutral-9" | "neutral-10" | "accent-1" | "accent-2" | "accent-3" | "accent-4" | "accent-5" | "accent-6" | "accent-7" | "accent-8" | "accent-9" | "accent-10" | "currentcolor" | "none" | "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "green" | "greenyellow" | "grey" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "transparent" | "turquoise" | "violet" | "wheat" | "whitesmoke" | "yellow" | "yellowgreen" | "ActiveBorder" | "ActiveCaption" | "AppWorkspace" | "Background" | "ButtonFace" | "ButtonHighlight" | "ButtonShadow" | "ButtonText" | "CaptionText" | "GrayText" | "Highlight" | "HighlightText" | "InactiveBorder" | "InactiveCaption" | "InactiveCaptionText" | "InfoBackground" | "InfoText" | "Menu" | "MenuText" | "Scrollbar" | "ThreeDDarkShadow" | "ThreeDFace" | "ThreeDHighlight" | "ThreeDLightShadow" | "ThreeDShadow" | "Window" | "WindowFrame" | "WindowText" | "alias-primary" | "alias-primary-hover" | "alias-secondary" | "alias-tertiary" | "alias-faint" | "alias-input-placeholder" | "child" | "context-fill" | "context-stroke" | ResponsiveValue<StrokeValue>
-
width
The image width.
0 | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | string & {} | "auto" | 1 | 13 | 2 | 3 | 4 | 6 | 14 | 5 | 7 | 8 | 9 | 10 | 11 | 12 | "fit-content" | "max-content" | "min-content" | "-moz-fit-content" | "-moz-max-content" | "-moz-min-content" | 15 | 16 | 17 | 18 | "-webkit-fit-content" | "-webkit-max-content" | "intrinsic" | "min-intrinsic" | ResponsiveValue<WidthValue>
-