Anatomy
With no label, aegov-separator renders a single native <hr>. With a text prop or slotted content, it renders a flex row of two line segments flanking a centred label instead.

| Item | Name | Description |
|---|---|---|
1 |
Line | The visible divider — a single <hr>, or two line segments either side of a label |
2 |
Label (optional) | Centred inline text or arbitrary slotted content, from the text prop or the default slot |
Basics
With no props, aegov-separator renders a plain horizontal line — a real native <hr> under the hood.
Personal details
Contact information
<p>Personal details</p>
<aegov-separator></aegov-separator>
<p>Contact information</p>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function SeparatorBasics() {
return (
<>
<p>Personal details</p>
<AegovSeparator />
<p>Contact information</p>
</>
);
}
<template>
<p>Personal details</p>
<aegov-separator></aegov-separator>
<p>Contact information</p>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-separator-basics',
imports: [AegovSeparator],
template: `
<p>Personal details</p>
<aegov-separator></aegov-separator>
<p>Contact information</p>
`,
})
export class SeparatorBasicsComponent {}
Orientation
Horizontal is the default and fills the full width of its container. A vertical separator needs a height context — place it inside a parent with a defined height, such as a flex row of links.
<div class="flex items-center gap-3" style="height:1.5rem;">
<a href="/edit">Edit</a>
<aegov-separator orientation="vertical"></aegov-separator>
<a href="/share">Share</a>
<aegov-separator orientation="vertical"></aegov-separator>
<a href="/delete">Delete</a>
</div>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function SeparatorOrientation() {
return (
<div style={{ display: 'flex', alignItems: 'center', gap: '0.75rem', height: '1.5rem' }}>
<a href="/edit">Edit</a>
<AegovSeparator orientation="vertical" />
<a href="/share">Share</a>
<AegovSeparator orientation="vertical" />
<a href="/delete">Delete</a>
</div>
);
}
<template>
<div class="flex items-center gap-3" style="height:1.5rem;">
<a href="/edit">Edit</a>
<aegov-separator orientation="vertical"></aegov-separator>
<a href="/share">Share</a>
<aegov-separator orientation="vertical"></aegov-separator>
<a href="/delete">Delete</a>
</div>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-separator-orientation',
imports: [AegovSeparator],
template: `
<div class="flex items-center gap-3" style="height:1.5rem;">
<a href="/edit">Edit</a>
<aegov-separator orientation="vertical"></aegov-separator>
<a href="/share">Share</a>
<aegov-separator orientation="vertical"></aegov-separator>
<a href="/delete">Delete</a>
</div>
`,
})
export class SeparatorOrientationComponent {}
Appearance
appearance tunes the line treatment: solid (full-strength) for clear section breaks, light (subtle, low-contrast) where the divider should recede behind surrounding content.
Solid
Light
<aegov-separator appearance="solid"></aegov-separator>
<aegov-separator appearance="light"></aegov-separator>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function SeparatorAppearance() {
return (
<>
<AegovSeparator appearance="solid" />
<AegovSeparator appearance="light" />
</>
);
}
<template>
<aegov-separator appearance="solid"></aegov-separator>
<aegov-separator appearance="light"></aegov-separator>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-separator-appearance',
imports: [AegovSeparator],
template: `
<aegov-separator appearance="solid"></aegov-separator>
<aegov-separator appearance="light"></aegov-separator>
`,
})
export class SeparatorAppearanceComponent {}
Variant
variant selects the colour family applied to the line and, when present, the text label.
| Variant | Solid | Light |
|---|---|---|
primary |
primary-600 |
primary-200 |
secondary |
secondary-600 |
secondary-200 |
neutral-max |
aeblack-800 |
aeblack-400 |
neutral-min |
aeblack-100 |
aeblack-50 |
Variant example
<aegov-separator variant="primary" appearance="solid"></aegov-separator>
<aegov-separator variant="secondary" appearance="solid"></aegov-separator>
<aegov-separator variant="neutral-max" appearance="solid"></aegov-separator>
<aegov-separator variant="neutral-min" appearance="solid"></aegov-separator>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function SeparatorVariants() {
return (
<>
<AegovSeparator variant="primary" appearance="solid" />
<AegovSeparator variant="secondary" appearance="solid" />
<AegovSeparator variant="neutral-max" appearance="solid" />
<AegovSeparator variant="neutral-min" appearance="solid" />
</>
);
}
<template>
<aegov-separator variant="primary" appearance="solid"></aegov-separator>
<aegov-separator variant="secondary" appearance="solid"></aegov-separator>
<aegov-separator variant="neutral-max" appearance="solid"></aegov-separator>
<aegov-separator variant="neutral-min" appearance="solid"></aegov-separator>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-separator-variants',
imports: [AegovSeparator],
template: `
<aegov-separator variant="primary" appearance="solid"></aegov-separator>
<aegov-separator variant="secondary" appearance="solid"></aegov-separator>
<aegov-separator variant="neutral-max" appearance="solid"></aegov-separator>
<aegov-separator variant="neutral-min" appearance="solid"></aegov-separator>
`,
})
export class SeparatorVariantsComponent {}
Gap
gap accepts any non-negative number and applies that many Tailwind spacing units of padding on either side of the line — one unit is 0.25rem (4px), so gap="4" produces 1rem (16px). Horizontal orientation applies it as padding-block (top + bottom); vertical applies it as padding-inline (start + end).
Content above
gap="0" — no padding
gap="4" — 1rem (16px)
gap="8" — 2rem (32px)
<p>Content above</p>
<aegov-separator variant="neutral-max" gap="0"></aegov-separator>
<p>gap="0" — no padding</p>
<aegov-separator variant="neutral-max" gap="4"></aegov-separator>
<p>gap="4" — 1rem (16px)</p>
<aegov-separator variant="neutral-max" gap="8"></aegov-separator>
<p>gap="8" — 2rem (32px)</p>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function SeparatorGap() {
return (
<>
<p>Content above</p>
<AegovSeparator variant="neutral-max" gap={0} />
<p>gap=0 — no padding</p>
<AegovSeparator variant="neutral-max" gap={4} />
<p>gap=4 — 1rem (16px)</p>
<AegovSeparator variant="neutral-max" gap={8} />
<p>gap=8 — 2rem (32px)</p>
</>
);
}
<template>
<p>Content above</p>
<aegov-separator variant="neutral-max" gap="0"></aegov-separator>
<p>gap="0" — no padding</p>
<aegov-separator variant="neutral-max" gap="4"></aegov-separator>
<p>gap="4" — 1rem (16px)</p>
<aegov-separator variant="neutral-max" gap="8"></aegov-separator>
<p>gap="8" — 2rem (32px)</p>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-separator-gap',
imports: [AegovSeparator],
template: `
<p>Content above</p>
<aegov-separator variant="neutral-max" gap="0"></aegov-separator>
<p>gap="0" — no padding</p>
<aegov-separator variant="neutral-max" gap="4"></aegov-separator>
<p>gap="4" — 1rem (16px)</p>
<aegov-separator variant="neutral-max" gap="8"></aegov-separator>
<p>gap="8" — 2rem (32px)</p>
`,
})
export class SeparatorGapComponent {}
Separator with text
Set text to render an inline label centred between two line segments — a common pattern between two alternative actions, such as sign-in methods. Pass richer markup (like an inline icon) as slotted default-slot content instead of text when plain text isn't enough.
<button class="w-full">Sign in with Emirates ID</button>
<aegov-separator text="OR"></aegov-separator>
<button class="w-full">Sign in with UAE Pass</button>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function SeparatorWithText() {
return (
<>
<button className="w-full">Sign in with Emirates ID</button>
<AegovSeparator text="OR" />
<button className="w-full">Sign in with UAE Pass</button>
</>
);
}
<template>
<button class="w-full">Sign in with Emirates ID</button>
<aegov-separator text="OR"></aegov-separator>
<button class="w-full">Sign in with UAE Pass</button>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-separator-with-text',
imports: [AegovSeparator],
template: `
<button class="w-full">Sign in with Emirates ID</button>
<aegov-separator text="OR"></aegov-separator>
<button class="w-full">Sign in with UAE Pass</button>
`,
})
export class SeparatorWithTextComponent {}
Decorative vs. semantic
By default a separator is decorative (role="presentation"), so assistive technology skips it entirely. Set is-decorative="false" when the divider carries real meaning — for example, separating two distinct groups of results — so it's exposed as role="separator" instead.
Active applications
Archived applications
<p>Active applications</p>
<aegov-separator is-decorative="false"></aegov-separator>
<p>Archived applications</p>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function SeparatorSemantic() {
return (
<>
<p>Active applications</p>
<AegovSeparator isDecorative={false} />
<p>Archived applications</p>
</>
);
}
<template>
<p>Active applications</p>
<aegov-separator is-decorative="false"></aegov-separator>
<p>Archived applications</p>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-separator-semantic',
imports: [AegovSeparator],
template: `
<p>Active applications</p>
<aegov-separator [isDecorative]="false"></aegov-separator>
<p>Archived applications</p>
`,
})
export class SeparatorSemanticComponent {}
RTL support
The separator is symmetric and direction-agnostic. The horizontal line fills its container identically in either direction, and the text-bearing variant centres its label with the flanking lines flipping naturally via flex layout — no extra configuration is needed.
<div dir="rtl">
<button class="w-full">تسجيل الدخول بالهوية الإماراتية</button>
<aegov-separator text="أو"></aegov-separator>
<button class="w-full">تسجيل الدخول عبر الهوية الرقمية</button>
</div>
import { AegovSeparator } from '@aegov/designsystem-react';
export default function RtlSeparator() {
return (
<div dir="rtl">
<button className="w-full">تسجيل الدخول بالهوية الإماراتية</button>
<AegovSeparator text="أو" />
<button className="w-full">تسجيل الدخول عبر الهوية الرقمية</button>
</div>
);
}
<template>
<div dir="rtl">
<button class="w-full">تسجيل الدخول بالهوية الإماراتية</button>
<aegov-separator text="أو"></aegov-separator>
<button class="w-full">تسجيل الدخول عبر الهوية الرقمية</button>
</div>
</template>
import { Component } from '@angular/core';
import { AegovSeparator } from '@aegov/designsystem-angular';
@Component({
selector: 'app-rtl-separator',
imports: [AegovSeparator],
template: `
<div dir="rtl">
<button class="w-full">تسجيل الدخول بالهوية الإماراتية</button>
<aegov-separator text="أو"></aegov-separator>
<button class="w-full">تسجيل الدخول عبر الهوية الرقمية</button>
</div>
`,
})
export class RtlSeparatorComponent {}
Usage
Here is the recommended usage of a separator on any website or application. These are recommended usage guides, however the developer must use the best practices of web and application development to accurately use this component.
Use the default decorative mode for purely visual dividers
Most separators exist to give a page visual rhythm, not to convey information — leaving is-decorative at its default keeps them silent for screen-reader users, exactly as intended.
Give a vertical separator an explicit height context
A vertical separator takes its height from its parent — place it inside a flex row with a fixed height, or put a height class on the host, or it shrinks to its 1rem minimum.
Do not rely on a separator alone to convey a meaningful grouping boundary to screen-reader users
A purely visual line change is invisible to assistive technology by default. If the boundary is meaningful, set is-decorative="false" explicitly rather than assuming the line itself communicates anything.
API reference
The following are the properties and references of a separator
aegov-separator default properties
| Attribute | Description | Type | Default |
|---|---|---|---|
| Direction of the separator. A vertical separator stretches to its parent's height ( |
|
|
| Line treatment: |
|
|
| Colour family applied to the line and, when present, the text label. |
|
|
| Inline label rendered centred between two line segments. An alternative to slotting the label as child content — when both are supplied, |
| (none) |
| Padding on either side of the line, in Tailwind spacing units (1 unit = |
|
|
| When |
|
|
| Additional CSS classes merged onto the inner separator element (the real |
| (none) |
Slots
| Slot | Description |
|---|---|
(default) | An alternative to the |
Pass-through attributes
| Attribute | Notes |
|---|---|
| Not specially forwarded — apply them directly to |
| Applied to the host element as usual. Use |
Notes
The following notes are applicable of this component.
Built-in accessibility
- With no label,
aegov-separatorrenders a real native<hr>— inherently correct semantics with zero ARIA needed for the plain case. - Defaults to
role="presentation"(is-decorativedefaults totrue), so a purely visual divider generates no noise for screen readers. - Setting
is-decorative="false"exposesrole="separator"instead, so assistive technology announces it as a real structural divider. aria-orientationis set to matchorientation, but only when the separator's role isseparator— it's correctly omitted entirely when the role ispresentation, sincearia-orientationisn't meaningful on an element assistive technology is told to ignore.- Supplying
text(or slotted content) always forcesrole="separator", even ifis-decorativeis left at its defaulttrue— a labelled divider inherently carries structural meaning, so the component doesn't let it stay purely decorative by accident.
Developer responsibility
The following is required for a developer to add additionally or pay attention to regarding this component.
- Use the default decorative mode for purely visual breaks. Only set
is-decorative="false"when the divider itself carries meaning worth announcing — for example, separating two distinct groups within a list of results. - A vertical separator needs a height context — place it inside a parent with a defined height (e.g. a flex row with a fixed height) or give the host a height class (e.g.
class="h-6"). On its own it only reaches its 1rem minimum height. A height inextra-classhas no effect. - Set props in markup before the separator renders. The label check reads the host's children on every render, and an unlabelled separator's own rendered
<hr>counts as one, so changing a prop later switches it to the labelled layout with an empty label. To change an unlabelled separator at runtime, replace the element. - Do not rely on a label being announced — screen readers treat the content of a
separatoras presentational. Convey the meaning in surrounding text or headings, and mark an icon used as a labelaria-hidden="true". - Keep label text short — a long label in a text-bearing separator can wrap awkwardly on narrow viewports.