Separator
A line between sections, across or up and down. The same in every style.
Usage
import { Component, ViewEncapsulation } from '@angular/core';import { ScSeparator } from '@semantic-components/ui';
@Component({ selector: 'app-separator-usage-demo', imports: [ScSeparator], template: ` <div class="flex max-w-sm flex-col gap-4 text-sm"> <div class="flex flex-col gap-1.5"> <div class="leading-none font-medium">shadcn/ui</div> <div class="text-muted-foreground"> The Foundation for your Design System </div> </div> <div scSeparator></div> <div> A set of beautifully designed components that you can customize, extend, and build on. </div> </div> `, host: { class: 'flex w-full justify-center' }, encapsulation: ViewEncapsulation.None,})export class SeparatorUsageDemo {}Anatomy
A directive on your div; orientation sets which way it runs.
import { ScSeparator } from '@semantic-components/ui';<div scSeparator orientation="…"></div>Accessibility
- A separator (role="separator", aria-orientation): screen readers announce the break, as for an hr.
- Only decoration — a line under a heading, behind "Or continue with" — hide it yourself: aria-hidden="true".
Examples
List
- Item 1
- Value 1
- Item 2
- Value 2
- Item 3
- Value 3
import { Component, ViewEncapsulation } from '@angular/core';import { ScSeparator } from '@semantic-components/ui';
/** Lines between the items of a list. */@Component({ selector: 'app-list-separator-demo', imports: [ScSeparator], template: ` <div class="flex w-full max-w-sm flex-col gap-2 text-sm"> <dl class="flex items-center justify-between">Menu
SettingsManage preferences
AccountProfile & security
HelpSupport & docs
import { Component, ViewEncapsulation } from '@angular/core';import { ScSeparator } from '@semantic-components/ui';
/** Vertical lines between columns; the last column and its line only from md up. */@Component({ selector: 'app-menu-separator-demo', imports: [ScSeparator], template: ` <div class="flex items-center gap-2 text-sm md:gap-4"> <div class="flex flex-col gap-1">Vertical
Blog
Docs
Source
import { Component, ViewEncapsulation } from '@angular/core';import { ScSeparator } from '@semantic-components/ui';
/** orientation="vertical": a line up and down, as tall as its row. */@Component({ selector: 'app-vertical-separator-demo', imports: [ScSeparator], template: ` <div class="flex h-5 items-center gap-4 text-sm"> <div>Blog</div>RTL
shadcn/ui
الأساس لنظام التصميم الخاص بك
مجموعة من المكونات المصممة بشكل جميل يمكنك تخصيصها وتوسيعها والبناء عليها.
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import { ScSeparator } from '@semantic-components/ui';
/** In a right-to-left page: the text from the right; the line is the same. */@Component({ selector: 'app-rtl-separator-demo', imports: [Dir, ScSeparator], template: ` <div dir="rtl" lang="ar">API reference
Each part takes class, merged over the style (cn: a later class wins).
| Part | Selector | Description |
|---|---|---|
ScSeparator | div[scSeparator] | A line between sections: role="separator", orientation ('horizontal', 'vertical'). The same in every style. |