Skeleton API
Demos
For examples and details on the usage of this React component, visit the component demo pages:
Import
import Skeleton from '@mui/joy/Skeleton';
// or
import { Skeleton } from '@mui/joy';Props
Props of the native component are also available.
The animation. If false the animation effect is disabled.
Type:
'pulse' | 'wave' | falseDefault:
'pulse'Used to render icon or text elements inside the Skeleton if src is not set. This can be an element, or just a string.
Type:
nodeThe component used for the root node. Either a string to use a HTML element or a component.
Type:
elementTypeHeight of the skeleton. Useful when you don't want to adapt the skeleton to a text element but for instance a card.
Type:
Array<number | string> | number | { lg?: number | string, md?: number | string, sm?: number | string, xl?: number | string, xs?: number | string } | stringApplies the theme typography styles.
Type:
'h1' | 'h2' | 'h3' | 'h4' | 'title-lg' | 'title-md' | 'title-sm' | 'body-lg' | 'body-md' | 'body-sm' | 'body-xs' | 'inherit' | stringDefault:
variant === 'text' ? 'body-md' : 'inherit'If true, the skeleton's position will change to absolute to fill the available space of the nearest parent. This prop is useful to create a placeholder that has the element's dimensions.
Type:
boolDefault:
falseThe system prop that allows defining system overrides as well as additional CSS styles.
Type:
Array<func | object | bool> | func | objectThe type of content that will be rendered.
Type:
'circular' | 'inline' | 'overlay' | 'rectangular' | 'text' | stringDefault:
'overlay'ref is forwarded to the root element.Theme default props
You can useJoySkeleton to change the default props of this component with the theme.Slots
To learn how to customize the slot, check out the Overriding component structure guide.
You can override the style of the component using one of these customization options:
- With a global class name.
- With a rule name as part of the component's
styleOverridesproperty in a custom theme.
CSS classes
These class names are useful for styling with CSS. They are applied to the root slot when specific states are triggered.