Skip to main content

Separator

A thin line between pieces of content.

import { Separator } from 'patine-ui';
Loading…
<VStack gap="md">
  <VStack gap="xs">
    <Text weight="medium">Patine UI</Text>
    <Text size="sm" color="textSecondary">Components for iOS, Android and the web.</Text>
  </VStack>
  <Separator />
  <HStack gap="md" align="center" style={{ height: 20 }}>
    <Text size="sm">Docs</Text>
    <Separator orientation="vertical" />
    <Text size="sm">Components</Text>
    <Separator orientation="vertical" />
    <Text size="sm">GitHub</Text>
  </HStack>
</VStack>

Try the props​

Props
orientation
<Separator />

Example: a receipt​

A café's digital receipt: full-width lines split the order from the totals and the payment, and vertical ones split the details in the header row.

Loading…
<Box border radius="lg" padding="lg" gap="md" style={{ width: '100%', maxWidth: 360 }}>
  <VStack gap="xs" align="center">
    <Text size="lg" weight="semibold">Kaffeebar Nord</Text>
    <HStack gap="sm" align="center" style={{ height: 16 }}>
      <Text size="sm" color="textSecondary">Nov 18</Text>
      <Separator orientation="vertical" />
      <Text size="sm" color="textSecondary">09:42</Text>
      <Separator orientation="vertical" />
      <Text size="sm" color="textSecondary">Table 4</Text>
    </HStack>
  </VStack>
  <Separator />
  <VStack gap="xs">
    {LINES.map((l) => (
      <Row key={l.item} left={`${l.qty} × ${l.item}`} right={`€${(l.qty * l.price).toFixed(2)}`} />
    ))}
  </VStack>
  <Separator />
  <VStack gap="xs">
    <Row left="Subtotal" right={`€${subtotal.toFixed(2)}`} />
    <Row left="incl. VAT 9%" right={`€${(subtotal - subtotal / 1.09).toFixed(2)}`} />
    <Row left="Total" right={`€${subtotal.toFixed(2)}`} bold />
  </VStack>
  <Separator />
  <Text size="sm" color="textSecondary">Paid with Visa •••• 4242</Text>
</Box>

Accessibility​

A separator is decorative by default, so screen readers skip it. Set decorative={false} when it divides content in a meaningful way; it's then announced as a separator with its orientation.

Props​

Separator also takes View props.

PropTypeDefaultDescription
orientation'horizontal' | 'vertical''horizontal'The line's direction.
decorativebooleantrueHide it from screen readers.
themeDeepPartial<Theme>—Theme override.