Skip to content
Stylhero 0.6.2
React Native

Theme

Core

Feedback

Inputs

Navigation

Overlays

React Native / Feedback

Skeleton

Placeholder shape shown while content loads. Hidden from screen readers: put a Spinner or an accessibilityLabel="Loading" on the area around the skeletons so the loading state is still announced. Stops pulsing under Reduce Motion.

import { Skeleton } from "@stylhero/native";

Example

import { Skeleton, Stack } from "@stylhero/native";

function SkeletonExample() {
  return (
    <Stack direction="row" gap={3} align="center">
      <Skeleton circle height={40} />
      <Stack gap={2} style={{ flex: 1 }}>
        <Skeleton width="60%" />
        <Skeleton width="40%" height={12} />
      </Stack>
    </Stack>
  );
}

Props

PropTypeDefaultDescription
circle boolean - A circle height wide, e.g. an avatar placeholder.
height number 16
radius RadiusToken | number "sm" Radius token or a number. Ignored when circle is set.
style StyleProp<ViewStyle> -
testID string -
width DimensionValue "100%"

Types

type RadiusToken = keyof typeof radius;

Accessibility

  • Hidden from screen readers; put a Spinner or text nearby to say something is loading.
  • The pulse is skipped when Reduce Motion is on.

Generated from src/components/Skeleton.tsx. Something wrong or missing? Open an issue.