For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
FrakmentFrakment

Separator

A visual divider for React Native apps running on Android and iOS via Expo.

frakment
Primitives for AI interfaces
A set of beautifully designed components you can customize, extend, and build on.
separator.tsx
import { View, type ViewProps, type ViewStyle } from "react-native";

import { useThemeColors } from "@/lib/theme";
import { cn } from "@/lib/utils";

export interface SeparatorProps extends Omit<ViewProps, "style"> {
  decorative?: boolean;
  orientation?: "horizontal" | "vertical";
  style?: ViewStyle;
}

function Separator({
  decorative = true,
  orientation = "horizontal",
  className,
  style,
  ...props
}: SeparatorProps) {
  const colors = useThemeColors();
  const isHorizontal = orientation === "horizontal";

  const baseStyle: ViewStyle = {
    backgroundColor: colors.border,
    flexShrink: 0,
    ...(isHorizontal
      ? { height: 1, width: "100%" }
      : { alignSelf: "stretch", width: 1 }),
    ...style,
  };

  return (
    <View
      accessibilityRole={decorative ? "none" : undefined}
      accessible={!decorative}
      className={cn(className)}
      style={baseStyle}
      {...props}
    />
  );
}

export { Separator };

A View-based divider. Horizontal by default, vertical with orientation="vertical". When decorative is true (the default) it is hidden from assistive tech. Set decorative={false} when the divider carries structural meaning and should be announced. The color comes from useThemeColors().border, so it tracks light and dark mode without extra configuration.

Installation

Usage

separator.tsx
import { Separator } from "@/components/ui/separator";
separator.tsx
<Separator />;

Vertical

Docs
Source
Design
separator-vertical.tsx
import { Text, View } from "react-native";

import { Separator } from "@/components/ui/separator";

export function SeparatorVerticalExample() {
  return (
    <View className="h-6 flex-row items-center gap-4">
      <Text>Docs</Text>
      <Separator orientation="vertical" />
      <Text>Source</Text>
      <Separator orientation="vertical" />
      <Text>Design</Text>
    </View>
  );
}

Pass orientation="vertical". The divider sets width to 1px and stretches to fill its parent height. Use it inside a flex-row container.

tsx
<View className="h-6 flex-row items-center gap-4">
  <Text>Docs</Text>
  <Separator orientation="vertical" />
  <Text>Source</Text>
</View>

Semantic

Section one
Section two
separator-decorative.tsx
import { Text, View } from "react-native";

import { Separator } from "@/components/ui/separator";

export function SeparatorDecorativeExample() {
  return (
    <View className="gap-4">
      <Text>Section one</Text>
      <Separator decorative={false} />
      <Text>Section two</Text>
    </View>
  );
}

Default decorative is true, matching web behavior. Pass decorative={false} to expose the divider to assistive tech. Visual appearance does not change between the two modes.

API Reference

PropTypeDefaultDescription
orientation
horizontalvertical
horizontalDivider direction.
decorativebooleantrueHides the divider from the accessibility tree when true.
classNamestring—Additional NativeWind classes.
styleViewStyle—Inline style override, merged after the computed divider style.

Accessibility

  • Default decorative is true, so the divider is hidden from screen readers. Set decorative={false} when the divider carries structural meaning.
  • The divider has no text content. No accessibilityLabel is needed.
  • Native does not expose aria-orientation. Orientation is visual only.

Best Practices

  • Prefer the default horizontal divider. Vertical dividers are harder to hit with a finger and rarely needed in touch layouts.
  • Do not use a separator as a margin trick. Use gap or padding on the parent View instead.
  • Keep separators one-pixel. The 1px width and height match the web component. Scaling beyond 1px reads as a border, not a divider.

Platform notes

  • No <hr> element. React Native renders the separator as a View with a 1px height or width.
  • No motion prop. The separator does not animate. Web also does not animate it, so behavior matches.
  • Color comes from the theme. The web version uses the border CSS variable. Native reads useThemeColors().border, so the resolved color matches across platforms.