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 so it follows the active semantic theme. Verify the resulting contrast in every application theme you ship.

import { Tag } from '@cratis/components/Display';
<Tag severity="success" value="In stock" />
<Tag severity="danger" value="Out of stock" />
<Tag severity="info" value="Member" icon="product-icons product-user" />
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. A string is treated as a complete consumer-owned icon-font CSS class; other React nodes render as supplied.
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/sample-user.png" />
<Avatar label="SU" />
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.

An inline status message with a severity tone and optional leading icon.

import { Message } from '@cratis/components/Display';
<Message severity='success'>Saved successfully.</Message>
<Message severity='error' text='The request failed.' />
<Message severity='info' icon={false}>No icon is shown.</Message>
PropTypeDescription
severity'info' | 'success' | 'warn' | 'error' | 'secondary' | 'contrast'Visual and semantic tone. Defaults to 'info'.
textReactNodeMessage content when children is not provided.
childrenReactNodeMessage content; takes precedence over text.
iconReactNode | falseCustom leading icon. Pass false to hide the icon; otherwise a severity symbol is used by default.
classNamestringExtra CSS class on the root.

Error messages use role='alert'; every other severity uses role='status'. The decorative icon is hidden from assistive technology. Stable root, icon, and text data-cratis-part markers are available for styling and tests.

An indeterminate loading spinner for work whose completion percentage is unknown.

import { ProgressSpinner } from '@cratis/components/Display';
<ProgressSpinner aria-label='Loading authors' />
<ProgressSpinner style={{ width: '2rem', height: '2rem' }} />
PropTypeDescription
styleCSSPropertiesRoot styles; use width and height to size the spinner.
classNamestringExtra CSS class on the root.
aria-labelstringLoading status announced to assistive technology. Defaults to 'Loading'; localize it.

ProgressSpinner renders a role='status' root. It exposes stable root, svg, track, and range data-cratis-part markers plus data-busy='true' and data-loading='true' on the root.

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 %.
aria-labelstringAccessible name. Defaults to 'Progress'; override it to describe the operation.
aria-labelledbystringId of an external element that labels the progress indicator.
classNamestringExtra CSS class on the root.

ProgressBar exposes stable root, indicator, and label data-cratis-part markers and data-mode on the root. It does not expose a pt prop; use className, the stable markers, or semantic tokens for product styling.

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.