Skeleton API
API reference docs for the React Skeleton component. Learn about the props, CSS, and other APIs of this exported module.
Component demos
Import
import Skeleton from '@mui/joy/Skeleton';
// or
import { Skeleton } from '@mui/joy';
Props of the native component are also available.
The animation. If false
the animation effect is disabled.
Type:'pulse'
| 'wave'
| false
Default:'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:node
The component used for the root node. Either a string to use a HTML element or a component.
Type:elementType
Height 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 }
| string
Applies the theme typography styles.
Type:'h1'
| 'h2'
| 'h3'
| 'h4'
| 'title-lg'
| 'title-md'
| 'title-sm'
| 'body-lg'
| 'body-md'
| 'body-sm'
| 'body-xs'
| 'inherit'
| string
Default: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:bool
Default:false
The components used for each slot inside.
See Slots API below for more details.
Type:{ root?: elementType }
Default:{}
The system prop that allows defining system overrides as well as additional CSS styles.
See the `sx` page for more details.
Type:Array<func
| object
| bool>
| func
| object
The type of content that will be rendered.
To learn how to add your own variants, check out Themed components—Extend variants.
Type:'circular'
| 'inline'
| 'overlay'
| 'rectangular'
| 'text'
| string
Default:'overlay'
ref
is forwarded to the root element.Theme default props
You can use JoySkeleton
to change the default props of this component with the theme.
To learn how to customize the slot, check out the Overriding component structure guide.
These class names are useful for styling with CSS. They are applied to the component's slots when specific states are triggered.
Class name applied to the root element if variant="circular"
.
Rule name:variantCircular
Class name applied to the root element if variant="inline"
.
Rule name:variantInline
Class name applied to the root element if variant="overlay"
.
Rule name:variantOverlay
Class name applied to the root element if variant="rectangular"
.
Rule name:variantRectangular
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
styleOverrides
property in a custom theme.