Color Schemes for Skeleton are not implemented in the default theme. You can extend the theme to implement them.
Skeleton
Skeleton is used to display the loading state of some components.
Import#
import { Skeleton, SkeletonCircle, SkeletonText } from "@chakra-ui/react"
Usage#
You can use it as a standalone component.
Or to wrap another component to take the same height and width.
Useful when fetching remote data.
import { Box } from "@chakra-ui/react"function Card() {const { data, loading, error } = useRemoteData()if (error) return <Box children="error" />return (<Box><Skeleton isLoaded={!loading}><Heading>{data.title}</Heading></Skeleton></Box>)}
Circle and Text Skeleton#
Skeleton color#
You can change the animation color with startColor and endColor.
Skipping the skeleton when content is loaded#
You can prevent the skeleton from rendering using the isLoaded prop.
Props#
colorScheme
colorScheme"whiteAlpha" | "blackAlpha" | "gray" | "red" | "orange" | "yellow" | "green" | "teal" | "blue" | "cyan" | "purple" | "pink" | "linkedin" | "facebook" | "messenger" | "whatsapp" | "twitter" | "telegram"endColor
endColorThe color at the animation end
stringfadeDuration
fadeDurationThe fadeIn duration in seconds
number0.4isLoaded
isLoadedIf true, it'll render its children with a nice fade transition
booleansize
sizeSizes for Skeleton are not implemented in the default theme. You can extend the theme to implement them.
stringspeed
speedThe animation speed in seconds
number0.8startColor
startColorThe color at the animation start
stringvariant
variantVariants for Skeleton are not implemented in the default theme. You can extend the theme to implement them.
string