Separator
Visually or semantically separates content. Renders as an hr element with proper accessibility.
Preview
A preview of the Separator component with interactive controls.
Interactive
Installation
Add the Separator component to your project.
ng g @ng-cn/core:c separatorUsage
Import and use the Separator component in your Angular application.
<div class="w-full max-w-md">
<div class="space-y-1">
<h4 class="text-sm font-medium leading-none">Radix Primitives</h4>
<p class="text-sm text-muted-foreground">An open-source UI component library.</p>
</div>
<Separator class="my-4" />
<div class="space-y-1">
<h4 class="text-sm font-medium leading-none">Installation</h4>
<p class="text-sm text-muted-foreground">How to install dependencies and structure your app.</p>
</div>
</div>Examples
Explore different variations and use cases for the Separator component.
Horizontal
Default horizontal separator between content sections.
Interactive
Vertical
Vertical separator between inline elements.
Interactive
In Navigation
Separator used in navigation menus.
Interactive
With Text Label
Separator with centered text label.
Interactive
In Card Layout
Separator between card sections.
Interactive
API Reference
Props | Prop | Type | Default | Description |
|---|---|---|---|
orientation | 'horizontal' | 'vertical' | 'horizontal' | The orientation of the separator. |
decorative | boolean | true | Whether the separator is decorative (aria-hidden). |
class | string | — | Additional CSS classes. |