Skip to content

Display

The Display components are small, presentational primitives for status and feedback — tags, badges, chips, avatars, progress, and loading skeletons. Import them from @cratis/components/Display.

Use them for status indicators in tables and detail views, counts on icons, removable filter tokens, user avatars, progress feedback, and placeholder shapes while data loads.

A small colored status label. Prefer a Tag with a severity over hand-colored text — it is theme-aware and meets contrast in light and dark.

import { Tag } from '@cratis/components/Display';
<Tag severity="success" value="In stock" />
<Tag severity="danger" value="Out of stock" />
PropTypeDescription
valueReactNodeThe label shown inside the tag (or pass children).
severity'secondary' | 'success' | 'info' | 'warn' | 'danger' | 'contrast'Severity tone (drives the color).
roundedbooleanFully rounds the tag.
iconReactNodeAn icon rendered before the label.
classNamestringExtra CSS class.

A small count or status marker, typically overlaid on an icon or button.

import { Badge } from '@cratis/components/Display';
<Badge value="8" severity="info" />
<Badge value="NEW" severity="success" />
PropTypeDescription
valueReactNodeThe value shown inside the badge (or pass children).
severity'secondary' | 'info' | 'success' | 'warn' | 'danger' | 'contrast'Severity tone.
size'small' | 'large' | 'xlarge'Badge size.
shape'circle'Renders the badge as a circle.
classNamestringExtra CSS class.

A labeled, optionally-removable token. Use for filter pills and selected values.

import { Chip } from '@cratis/components/Display';
<Chip label="Design" />
<Chip label="Removable" removable onRemove={() => remove('design')} />
PropTypeDescription
labelstringThe chip label.
iconReactNodeAn icon rendered before the label.
removablebooleanShows a remove control.
onRemove() => voidInvoked when the remove control is activated.
removeAriaLabelstringAccessible name for the remove control. Override to localize. Defaults to 'Remove'.
classNamestringExtra CSS class.

A user/entity avatar showing an image, initials, or an icon fallback.

import { Avatar } from '@cratis/components/Display';
<Avatar image="/users/jane.png" />
<Avatar label="JD" />
PropTypeDescription
imagestringImage URL. When present, the image is shown and everything below except alt is ignored.
altstringAlternative text for image. Unused when there is no image.
iconReactNodeIcon fallback when there is no image. Takes precedence over label.
labelstringInitials/text fallback when there is no image and no icon.
size'normal' | 'large' | 'xlarge'Avatar size.
classNamestringExtra CSS class.

The fallback order is imageiconlabel, so passing both an icon and a label shows the icon.

A horizontal progress indicator, determinate or indeterminate.

import { ProgressBar } from '@cratis/components/Display';
<ProgressBar value={65} />
<ProgressBar mode="indeterminate" />
PropTypeDescription
valuenumberCompletion value, 0100. Ignored in indeterminate mode.
mode'determinate' | 'indeterminate'determinate (default) shows value; indeterminate shows a looping animation.
showValuebooleanWhether to render the percentage label. Defaults to true (determinate only). The label is always value followed by %.
classNamestringExtra CSS class.

A placeholder shape shown while content loads.

import { Skeleton } from '@cratis/components/Display';
<Skeleton width="12rem" height="1rem" />
<Skeleton height="3rem" circle />
PropTypeDescription
widthstringAny CSS length. Defaults to '100%'. Ignored when circle is set.
heightstringAny CSS length. Defaults to '1rem'. Drives both dimensions when circle is set.
borderRadiusstringAny CSS length. Ignored when circle is set (which forces 50%).
circlebooleanRenders a circle: height is used for width and height, and the radius is forced to 50%.
classNamestringExtra CSS class.

Because circle takes its size from height, set height rather than width for a circular skeleton — <Skeleton circle /> on its own renders at the 1rem default.