Skip to content
Native Animation
Base Separator animation previewBase Separator animation preview

This preview uses fictional demo content. See the props below for the customization options available in this component.

npx nativeanimation add base-separator

Base Separator

React Native Separator Component

A static horizontal or vertical separator with configurable inset, optional horizontal label, semantics, and theme.

Native Animation Base · Free · MIT

Add to your project

Copy the component and its assets into your app with the Native Animation CLI, or paste the agent prompt into Claude Code, Codex or Cursor once the MCP server is connected.

About this component

A static horizontal or vertical separator with configurable inset, optional horizontal label, semantics, and theme.

How it works

  1. Lines are exactly 1 pt thick and use the theme border color.
  2. Horizontal labels use 12 pt muted text and 12 pt gaps between the text and the two lines.
  3. Vertical lines fill the host height. Give the host an explicit height; vertical insets shorten the visible line at each end.
  4. Decorative separators are hidden from accessibility; semantic separators use the separator role. There is no animation.

Install

npx nativeanimation add base-separator

The CLI also copies the family modules listed in registryDependencies. Dependencies, if you copy by hand:

npx expo install react-native-reanimated react-native-worklets

Usage

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

PropTypeDefaultDescription
orientation'horizontal' | 'vertical'horizontalLine direction.
insetnumber0Margin at the line ends, in points.
labelstring—Centered text for horizontal lines; ignored for vertical lines.
decorativebooleantrueHides the separator and label from screen readers.
themeBaseThemeproviderOverrides the theme from BaseThemeProvider.
styleStyleProp<ViewStyle>—Container style.
testIDstring—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.

Source code

Loading public source…