Examples

Labelled divider

Preview
or
Example.tsx
import { Button, Divider, Stack } from '@reactloom/ui';

export default function Example() {
  return (
    <Stack gap="4" style={{ width: '100%', maxWidth: 340 }}>
      <Button fullWidth>Continue with SSO</Button>
      <Divider label="or" />
      <Button fullWidth variant="secondary">Continue with email</Button>
    </Stack>
  );
}

Vertical separators

Preview
Example.tsx
import { HStack, Link, Separator } from '@reactloom/ui';

export default function Example() {
  return (
    <HStack gap="3" style={{ height: 20 }}>
      <Link href="#docs">Docs</Link>
      <Separator orientation="vertical" />
      <Link href="#api">API</Link>
      <Separator orientation="vertical" />
      <Link href="#status">Status</Link>
    </HStack>
  );
}

API reference

Separator props

Separator props
PropTypeDefault
orientation
'horizontal' | 'vertical''horizontal'
decorative
false exposes role="separator".
booleantrue

Divider props

Divider props
PropTypeDefault
label
Centred text; read as plain text.
ReactNode—

Customization

Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.

Divider

Renders Separator, so its hooks apply too.

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-orientation]horizontal · vertical

Theme tokens it reads

--pl-color-border-default --pl-color-fg-muted --pl-font-size-sm

Separator

State attributes

Target these in your CSS to style states without depending on class names.

AttributeValues
[data-orientation]horizontal · vertical

Theme tokens it reads

--pl-color-border-default

Accessibility

  • Decorative separators are hidden from assistive technology.

Usage guidelines

Do

  • Use whitespace before reaching for a line.

Don’t

  • Don’t use a separator as the only cue between unrelated content.