About this component
A static horizontal or vertical separator with configurable inset, optional horizontal label, semantics, and theme.
How it works
- Lines are exactly 1 pt thick and use the theme border color.
- Horizontal labels use 12 pt muted text and 12 pt gaps between the text and the two lines.
- Vertical lines fill the host height. Give the host an explicit height; vertical insets shorten the visible line at each end.
- Decorative separators are hidden from accessibility; semantic separators use the separator role. There is no animation.
Install
npx nativeanimation add base-separatorThe CLI also copies the family modules listed in registryDependencies. Dependencies, if you copy by hand:
npx expo install react-native-reanimated react-native-workletsUsage
import { View } from 'react-native';
import { BaseSeparator } from './base-separator';
<BaseSeparator inset={16} />
<BaseSeparator label="or" decorative={false} />
<View style={{ height: 44, flexDirection: 'row' }}>
<BaseSeparator orientation="vertical" />
</View>Wrap your app in BaseThemeProvider (from base-theme) to choose light/dark and an accent; without it, pieces use the light neutral theme. Every piece also takes a theme prop that wins over the provider.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
orientation | 'horizontal' | 'vertical' | horizontal | Line direction. |
inset | number | 0 | Margin at the line ends, in points. |
label | string | — | Centered text for horizontal lines; ignored for vertical lines. |
decorative | boolean | true | Hides the separator and label from screen readers. |
theme | BaseTheme | provider | Overrides the theme from BaseThemeProvider. |
style | StyleProp<ViewStyle> | — | Container style. |
testID | string | — | Stable identifier on the root view. |
Compatibility
Expo SDK 58 · React Native 0.88 · Reanimated 4.7 · react-native-worklets 0.13. Runs on iOS, Android and web, in Expo Go
and in development builds. Part of Native Animation Base, a free family that shares one theme: install
base-theme once (the CLI does it for you) and every Base piece picks it up. Free forever. MIT.
Accessibility
Decorative separators have no role and are hidden from screen readers. Set decorative={false} to expose a separator role and the optional label. This piece has no motion.
Part of a shared foundation
Use it in a screen
Compose Base Separator with other Base components and a single shared theme. Ask your agent to read each API, then connect real navigation, state, and callbacks.
Go further.
Base covers the everyday. Choose a more expressive interaction when your app calls for it.
Stacked Category Cards ↗
A category stack whose tabs unfold into detail cards, with configurable categories, title, colors, and fonts.
Another way to solve this task · $9Review Approval Card ↗
A moderation queue with swipe-to-approve or decline feedback, with configurable reviews, labels, colors, and fonts.
Source code
Loading public source…









