Skip to content
Harness Design System Harness Design System Harness Design System

Skeleton

The Skeleton component is a placeholder UI element that represents the loading state of a component. It can be used to indicate that content is being loaded or processed, providing a visual cue to users.

Usage

import { Skeleton } from "@harnessio/ui/components";
//...
return (
<Skeleton.Box className="w-[400px] h-[80px]" />
)

Anatomy

Skeleton Box

The Skeleton.Box component is a simple, flexible rectangular placeholder that can be used to indicate loading states for various UI elements. It is a free-form box — you can specify its width and height to match the shape of the content being loaded.

Skeleton Avatar

The Skeleton.Avatar component is a placeholder for user profile images or icons. It can be used to indicate loading states for avatar images.

Skeleton Icon

The Skeleton.Icon component is a placeholder for icons. It can be used to indicate loading states for icon-based UI elements.

The Skeleton.Logo component is a placeholder for logos. It can be used to indicate loading states for logo images.

Skeleton Typography

The Skeleton.Typography component is a placeholder for text elements. It can be used to indicate loading states for text content. Variants include different text styles such as headings, body text, and captions.

Skeleton Form

The Skeleton.Form component is a placeholder for form elements. It can be used to indicate loading states for input fields, labels, and other form controls. Orientation variants include vertical and horizontal layouts. linesCount can be used to specify the number of lines in the skeleton form item.

Skeleton List

The Skeleton.List component is a placeholder for list items. It can be used to indicate loading states for list content. linesCount can be used to specify the number of lines in the skeleton list item. The hasActions prop can be used to indicate that the list items have action buttons.

Skeleton Table

The Skeleton.Table component is a placeholder for table elements. It can be used to indicate loading states for table content. countRows can be used to specify the number of rows in the skeleton table. countColumns can be used to specify the number of columns in the skeleton table. showHeader can be used to indicate that the table has a header row.

API Reference

Skeleton.Box

Prop
Required
Default
Type
classNamefalsestring

Skeleton.Avatar

Prop
Required
Default
Type
sizefalse'md''sm' | 'md' | 'lg'
roundedfalsefalseboolean
classNamefalsestring

Skeleton.Icon

Prop
Required
Default
Type
sizefalse'sm''2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'
classNamefalsestring
Prop
Required
Default
Type
sizefalse'lg''sm' | 'md' | 'lg'
classNamefalsestring

Skeleton.Typography

Prop
Required
Default
Type
variantfalse'body''heading-hero' | 'heading-section' | 'heading-subsection' | 'heading-base' | 'heading-small' | 'body' | 'body-code' | 'body-single-line' | 'body-single-line-code' | 'caption' | 'caption-single-line'
classNamefalsestring

Skeleton.Form

Prop
Required
Default
Type
linesCountfalse91 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
classNamefalsestring
itemPropsfalse{ withLabel: true, orientation: 'vertical', size: 'md', linesCount: 3 }{ withLabel?: boolean; orientation?: 'vertical' | 'horizontal'; size?: 'sm' | 'md'; labelClassName?: string, inputClassName?: string }

Skeleton.List

Prop
Required
Default
Type
linesCountfalse8number
classNamefalsestring
hasActionsfalsefalseboolean
classNamesfalse{ item?: string; leftTitle?: string; leftDescription?: string, rightTitle?: string, rightDescription?: string, actions?: string }

Skeleton.Table

Prop
Required
Default
Type
countRowsfalse12number
countColumnsfalse5number
hideHeaderfalsefalseboolean
classNamefalsestring
classNameHeaderfalsestring
classNameBodyfalsestring