# Divider

A labelled or unlabelled structural rule with horizontal and vertical forms.

`Divider` separates related regions with a semantic separator. It supports two visual weights, two orientations, optional label content, and full-bleed geometry inside padded containers.

```tsx
import { Divider, Stack } from "@zentara-co/zenos-ui";

function DividerExample() {
  return (
    <Stack gap="6" className="w-full max-w-2xl">
      <Divider variant="subtle" aria-label="Subtle section boundary" />
      <Divider variant="strong" aria-label="Strong section boundary" />
      <Divider label="Workspace settings" />
    </Stack>
  );
}
```

## Import

```tsx
import { Divider } from "@zentara-co/zenos-ui";
```

## Orientation

Horizontal is the default. A vertical divider needs a parent with a meaningful height because it fills the parent's block size.

```tsx
import { Divider, Cluster, Grid, Stack, Text } from "@zentara-co/zenos-ui";

function DividerOrientationExample() {
  return (
    <Grid columns={{ base: 1, md: 2 }} gap="6" className="w-full">
      <Stack gap="3" className="rounded-xl border border-border p-4">
        <Text weight="bold">Horizontal</Text>
        <Divider />
        <Text color="subtle">Separates content along the block flow.</Text>
      </Stack>
      <Cluster
        align="center"
        justify="center"
        gap="4"
        className="h-28 rounded-xl border border-border p-4"
      >
        <Text>Editor</Text>
        <Divider orientation="vertical" />
        <Text>Preview</Text>
      </Cluster>
    </Grid>
  );
}
```

## Variants

Use `subtle` for routine content boundaries and `strong` when adjacent regions need clearer separation. Variant changes visual weight only.

```tsx
<Divider variant="subtle" />
<Divider variant="strong" />
```

## Labels

A label is centered between two rule segments and becomes the separator's accessible name unless `aria-label` or `aria-labelledby` is supplied explicitly. Labels may contain text or a small component such as Badge.

```tsx
import { Badge, Divider, Stack } from "@zentara-co/zenos-ui";

function DividerLabelExample() {
  return (
    <Stack gap="6" className="w-full max-w-2xl">
      <Divider label="Or continue with" />
      <Divider
        label={
          <Badge variant="default" color="information">
            Advanced
          </Badge>
        }
        variant="strong"
      />
      <Divider aria-label="End of account settings" />
    </Stack>
  );
}
```

## Full bleed

`isFullBleed` extends a divider through padding defined by the inherited container variables. This keeps surrounding content aligned while the rule reaches the surface edges.

```tsx
import { Divider, Stack, Text } from "@zentara-co/zenos-ui";
import { type CSSProperties } from "react";

const dividerPaddingVariables = {
  "--container-padding-inline-start": "1.5rem",
  "--container-padding-inline-end": "1.5rem",
} as CSSProperties;

function DividerFullBleedExample() {
  return (
    <Stack
      gap="4"
      className="w-full max-w-xl overflow-hidden rounded-xl border border-border bg-background-neutral-card p-6"
      style={dividerPaddingVariables}
    >
      <Text type="heading" size="h6">
        Activity
      </Text>
      <Text color="subtle">A regular divider stays inside the content padding.</Text>
      <Divider />
      <Text color="subtle">A full-bleed divider reaches both container edges.</Text>
      <Divider isFullBleed variant="strong" />
      <Text color="subtle">The content itself remains aligned to the padded inset.</Text>
    </Stack>
  );
}
```

Horizontal dividers read `--container-padding-inline-start` and `--container-padding-inline-end`. Vertical dividers use the corresponding block variables. An explicit `style` value can override the generated margins or dimensions.

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | subtle \| strong | subtle | Rule weight. |
| orientation | horizontal \| vertical | horizontal | Rule axis. |
| label | ReactNode | — | Optional content between rule segments. |
| isFullBleed | boolean | false | Extends through inherited container padding. |
| native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

Divider always renders `role="separator"` and exposes `aria-orientation`. Use a visible `label` when it helps everyone understand the transition, or an explicit accessible name when the boundary needs context that is already visually apparent. Avoid using Divider as a substitute for headings or whitespace when the content hierarchy needs stronger structure.

Source: https://zenos-ui.pages.dev/layout/divider/