suiss/uim · React Native Component

Separator

A thin horizontal or vertical line that separates content.

Separator is an open-source mobile component from suiss/uim for React Native and Expo, with SwiftUI and Jetpack Compose versions built from the same design tokens. The @esuiss/uim CLI copies its source into your project, so you own the code.

iOS
Separator on iOS in light mode

Separator is a View drawn as a one-pixel line. Horizontal separators fill the width of their container; vertical separators stretch to the height of a row.

Installation

$ pnpm dlx @esuiss/uim@latest add separator

Manual

  1. Install the dependencies:
npx expo install cn
  1. Add the pieces it builds on: the primitives components/primitives/separator.tsx, components/primitives/use-render.tsx.

  2. Copy the source into components/ui/separator.tsx:

uniwind/components/ui/separator.tsx
import { cn } from "cn"
import { Separator as SeparatorPrimitive } from "@/components/primitives/separator"
import { resolveClassName } from "@/components/primitives/use-render"

function Separator({
  className,
  ...props
}: React.ComponentProps<typeof SeparatorPrimitive>) {
  return (
    <SeparatorPrimitive
      className={(state) =>
        cn(
          "shrink-0 bg-separator",
          state.orientation === "horizontal"
            ? "h-px w-full"
            : "w-px self-stretch",
  1. Update the import paths to match your project.

Usage

import { Separator } from "@/components/ui/separator"
<View>
  <View className="gap-1">
    <Text className="text-sm font-medium">esuiss</Text>
    <Text variant="muted">An open-source UI component library.</Text>
  </View>
  <Separator className="my-4" />
  <View className="h-5 flex-row items-center gap-4">
    <Text className="text-sm">Blog</Text>
    <Separator orientation="vertical" />
    <Text className="text-sm">Docs</Text>
    <Separator orientation="vertical" />
    <Text className="text-sm">Source</Text>
  </View>
</View>

Use the default horizontal orientation between stacked blocks, and orientation="vertical" between items in a row. Add spacing with className, such as my-4.

Examples

Horizontal

A horizontal separator between two lines of text.

iOS
Separator (horizontal) on iOS in light mode

Vertical

A vertical separator between two items in a row.

iOS
Separator (vertical) on iOS in light mode

API Reference

Separator

ExtendsReact.ComponentProps<typeof SeparatorPrimitive>

Accessibility

  • The separator is decorative and hidden from VoiceOver and TalkBack.

Notes

  • Uses the bg-separator token.
  • Light and dark colors follow the system appearance.