Skip to content
Stylhero 0.8.0
Components

Core

Layout and type

Inputs

Overlays

Navigation

Data display

Charts

Transitions and utilities

Page pieces (landing pages, portfolios, docs)

Icons

Components / Layout and type

Divider

Horizontal or vertical separator line, with an optional label in the middle.

import { Divider } from "@stylhero/ui";

Example

Code
import { Divider, Stack, Text } from "@stylhero/ui";

function DividerExample() {
  return (
    <Stack gap={4}>
      <Text>Above</Text>
      <Divider />
      <Divider label="or" />
      <Stack direction="row" gap={3} align="center"><Text>Left</Text><Divider orientation="vertical" /><Text>Right</Text></Stack>
    </Stack>
  );
}

Props

PropTypeDefaultDescription
label ReactNode - Text in the middle of a horizontal divider, e.g. "or".
orientation "horizontal" | "vertical" "horizontal"

Also takes the HTML attributes of its root element (id, style, data-*, aria-*, event handlers…).

Accessibility

  • role="separator" with aria-orientation.

Generated from src/components/Divider.tsx. Something wrong or missing? Open an issue.