Divide groups of content with a horizontal or vertical line.

Use a separator between groups of content that a reader should take as separate, like a profile's header and its bio.

import { Component } from "@angular/core"
import { Separator } from "@ui-sdk/angular/separator"

@Component({
  imports: [Separator],
  template: `
    <div data-slot="stack">
      <div data-slot="stack">
        <h3>Hollis Grant</h3>
        <p data-slot="hint">hollis@example.com</p>
      </div>
      <div uiSeparator></div>
      <p>
        Designs the billing and onboarding flows, and reviews every new pricing
        page.
      </p>
    </div>
  `,
})
class Example {}

export { Example }
Read the profile with a screen reader. It announces a separator between Hollis Grant's name and email and the bio below.

Installation

npm install @ui-sdk/angular @ui-sdk/core

Usage

Import the separator and put it between two groups of content:

import { Component } from "@angular/core"
import { Separator } from "@ui-sdk/angular/separator"

@Component({
  selector: "app-example",
  imports: [Separator],
  template: `
    <section>
      <h2>Hollis Grant</h2>
      <div uiSeparator></div>
      <p>Designs the billing and onboarding flows.</p>
    </section>
  `,
})
class Example {}

export { Example }

Build Your Own

@ui-sdk/angular/separator comes with a ready-made Separator. If you'd like to build your own, with your own name, start from the separator primitive in @ui-sdk/core:

divider.ts
import { Directive, input } from "@angular/core"
import { separator } from "@ui-sdk/core/separator"
import { usePart, usePrimitive } from "@ui-sdk/angular/primitive"

@Directive({ selector: "[appDivider]" })
class Divider {
  readonly orientation = input<"horizontal" | "vertical">()
  readonly handle = usePrimitive(separator, () => ({
    orientation: this.orientation(),
  }))
  readonly state = usePart(this.handle, "root").state
}

export { Divider }
import { Component } from "@angular/core"
import { Divider } from "./divider"

@Component({
  selector: "app-divider-example",
  imports: [Divider],
  template: ` <div appDivider orientation="vertical"></div> `,
})
export class DividerExample {}

Divider keeps the behavior, state and data attributes of the ready-made Separator: the separator role, aria-orientation and data-orientation. See Rendering Primitives and Custom Parts for more.

Vertical

Set orientation="vertical" for a line between items in a row. It takes the row's height.

import { Component } from "@angular/core"
import { Separator } from "@ui-sdk/angular/separator"

@Component({
  imports: [Separator],
  template: `
    <nav aria-label="Legal" data-slot="row">
      <a href="#privacy">Privacy</a>
      <div uiSeparator orientation="vertical"></div>
      <a href="#terms">Terms</a>
      <div uiSeparator orientation="vertical"></div>
      <a href="#cookies">Cookies</a>
    </nav>
  `,
})
class Example {}

export { Example }
Read across Privacy, Terms and Cookies. A screen reader announces a vertical separator between each link.

Stacked Content

A vertical separator stretches to the tallest item in its row, so it spans a number and its label.

import { Component } from "@angular/core"
import { Separator } from "@ui-sdk/angular/separator"

@Component({
  imports: [Separator],
  template: `
    <div data-slot="row">
      <div data-slot="stack">
        <span>24</span>
        <span data-slot="hint">Projects</span>
      </div>
      <div uiSeparator orientation="vertical"></div>
      <div data-slot="stack">
        <span>1,280</span>
        <span data-slot="hint">Followers</span>
      </div>
      <div uiSeparator orientation="vertical"></div>
      <div data-slot="stack">
        <span>312</span>
        <span data-slot="hint">Following</span>
      </div>
    </div>
  `,
})
class Example {}

export { Example }
Compare the lines with the stats. Each one runs the full height of Projects, Followers and Following.

Rows

Put a separator between each pair of rows to divide a list of details.

import { Component } from "@angular/core"
import { Separator } from "@ui-sdk/angular/separator"

@Component({
  imports: [Separator],
  template: `
    <div data-slot="stack">
      <dl>
        <dt>Plan</dt>
        <dd>Pro</dd>
      </dl>
      <div uiSeparator></div>
      <dl>
        <dt>Seats</dt>
        <dd>8 of 10</dd>
      </dl>
      <div uiSeparator></div>
      <dl>
        <dt>Renews</dt>
        <dd>December 1, 2026</dd>
      </dl>
    </div>
  `,
})
class Example {}

export { Example }
Read the plan details with a screen reader. It announces a separator between Plan, Seats and Renews.

Decorative

Set decorative when the line adds no information. Here, the word “or” already says the two ways to sign in are separate, so a screen reader skips the lines.

import { Component } from "@angular/core"
import { Separator } from "@ui-sdk/angular/separator"

@Component({
  imports: [Separator],
  template: `
    <div data-slot="stack">
      <button type="button" data-variant="solid">Sign In with Passkey</button>
      <div data-slot="row">
        <div uiSeparator decorative></div>
        <span>or</span>
        <div uiSeparator decorative></div>
      </div>
      <button type="button">Email Me a Link</button>
    </div>
  `,
})
class Example {}

export { Example }
Read from Sign In with Passkey to Email Me a Link with a screen reader. It reads “or” and skips the lines.

A decorative separator gets role="none" and no aria-orientation. It keeps data-orientation for styling.

Custom Rendering

Put uiSeparator on a different element, such as an <hr>. See Parts and Composition for reading the separator's state.

Styling

The separator is unstyled. Give it a background, a height when it's horizontal and a width when it's vertical, and use data-orientation to tell them apart. A vertical line takes its row's height with align-self: stretch.

The separator has a data-slot of separator, and its data-orientation is listed under Data Attributes.

Data Attributes

Separator

[data-slot="separator"]

AttributeWhat it means
data-orientationhorizontalverticalWhich way the line runs.

API Reference

Each option below is an input on the directive.

Separator

orientation?SeparatorOrientation
Which way the line runs. A vertical separator divides items in a row.
decorative?boolean
Hides the separator from assistive technology with role="none", for a line that's only visual. Leave it off when the separator divides content a screen reader should hear as separate, like groups of menu items.
debug?boolean
Logs every state change with its reason to the console, in development builds.

State

What each part's state() signal holds.

orientationSeparatorOrientation
Which way the line runs.

Accessibility

The component follows the WAI-ARIA separator role. A separator divides content a screen reader should hear as separate, and it's announced with role="separator" and its aria-orientation. A decorative separator is only visual: it gets role="none", so screen readers skip it. Use decorative only when the surrounding content already conveys the division. Either way, a separator never takes focus, so Tab moves past it.

Tested Behavior

Every line below is an automated test.

  • A separator is announced with its orientation.
  • A separator can't be focused.
  • A separator carries its orientation for styling.

Runs in React, Vue and web components.