@impulse-ui-native/skeleton
v11.4.0
Published
Animated skeleton loading components for ImpulseUI Native applications.
Maintainers
Readme
@impulse-ui-native/skeleton
Composable, theme-aware placeholders for loading layouts.
Installation
pnpm add @impulse-ui-native/skeleton react-native-reanimated react-native-workletsComplete the Reanimated and Worklets setup required by your React Native or Expo project.
Main exports
Skeleton is a compound export with composable primitives and token-matched
component presets:
Skeleton.Containergroups placeholders and accepts theme spacing and flex props.Skeleton.Bonerenders a rectangular placeholder with border and dimension props.Skeleton.Textrenders a text-sized placeholder from sample text and a typography preset.Skeleton.Tagrenders a pill-shaped placeholder.Skeleton.Avatar,Badge,Button, andIconButtonmirror common display and action geometry.Skeleton.Checkbox,Radio, andSwitchmirror choice-control geometry.Skeleton.Controlcovers Input, Select, and date/time field surfaces;Skeleton.Textareacovers multiline fields.Skeleton.Slider,Progress,SegmentedControl, andPaginationpreserve data-control and navigation footprints.Skeleton.Dividermirrors horizontal or vertical separators.
The package also exports the prop types for each part.
Usage
import { Typography } from "@impulse-ui-native/primitives";
import { Skeleton } from "@impulse-ui-native/skeleton";
<Skeleton.Container gap="sm">
<Skeleton.Avatar size="large" />
<Skeleton.Text text="Loading account name" Component={Typography.Body} />
<Skeleton.Tag size="medium" width={80} />
</Skeleton.Container>;All presets accept the same spacing, border, flex, dimension, and style props
as Skeleton.Bone, so their token-derived defaults can be adjusted for the
content they replace. itemCount controls the width of Pagination and
SegmentedControl presets, rows controls Textarea height, and variant
selects linear or circular Progress geometry.
Skeleton colors, radii, line height, and gaps come from the active
ThemeProvider component tokens. Composite layouts such as cards, accordions,
steppers, and charts should be assembled from these presets and Skeleton.Bone
so the placeholder preserves the application-specific layout.
