Docs

Main site

Installation Browser support Extend config MCP server
Validation Page speed testing Responsive design
Accordion Aspect Ratio Avatar Badge Banner Bento Grid Blockquote Breadcrumbs Button Callout Card Drawer Dropdown Link Modal Navbar Navblock Pagination Popover Progress Separator Tabs Timeline Toast Tooltip
Checkbox Datepicker File upload Form field Input Label OTP Radio Range Select Textarea Toggle
Header Footer
Accordion Auth Checkbox & Radio Content Drawers Features Modals Statistics & Metrics Teams
Address Contact number Currency symbol Date Emirates ID Name
Close
Home Documentation Components Separator

Separator

A Separator is a thin visual divider used to break up sections of content, group related items, or signal a contextual boundary in an interface. "aegov-separator" renders a real native "hr" when used without a label, or a flex layout of line/text/line when a label is supplied, and supports horizontal or vertical orientation, two line treatments, and four colour variants.

decorative
Status
Active
Introduced
4.0.x
View source code

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.

Image showing anatomy of a separator

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>

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>

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>

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>

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>

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>

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>

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>

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

AttributeDescriptionTypeDefault

orientation

Direction of the separator. A vertical separator stretches to its parent's height (h-full) and falls back to a 1rem minimum, so give it a height context from its parent (or a height class on the host, e.g. class="h-6") for it to span the full row.

horizontal | vertical

horizontal

appearance

Line treatment: solid (full-strength) for clear section breaks, light (subtle, low-contrast) where the line should recede behind surrounding content. Colour resolves from variant.

solid | light

solid

variant

Colour family applied to the line and, when present, the text label.

primary | secondary | neutral-max | neutral-min

primary

text

Inline label rendered centred between two line segments. An alternative to slotting the label as child content — when both are supplied, text wins and the slotted content is not rendered.

string

(none)

gap

Padding on either side of the line, in Tailwind spacing units (1 unit = 0.25rem / 4px) — e.g. gap="4" is 1rem (16px). Horizontal orientation applies it as padding-block (top + bottom); vertical applies it as padding-inline (start + end). Any non-negative number is accepted; 0 keeps no padding.

number

0

is-decorative

When true, the separator exposes role="presentation" so assistive technology skips it entirely. When false, it exposes role="separator" so it's announced as a structural divider. Overridden automatically: as soon as text (or slotted content) is present, the separator always exposes role="separator" regardless of this prop — a labelled divider inherently carries structural meaning.

boolean

true

extra-class

Additional CSS classes merged onto the inner separator element (the real <hr>, or the wrapping <div> when a label is present) — not the host. The component's own unlayered rules win over Tailwind utilities, so it cannot change margin, width, height, display or the border; put those on the host instead.

string

(none)

Slots

SlotDescription

(default)

An alternative to the text prop for the inline label — accepts arbitrary HTML (e.g. an icon), not just plain text. Ignored when text is also set.

Pass-through attributes

AttributeNotes

aria-*, data-*

Not specially forwarded — apply them directly to <aegov-separator> itself, since it renders in the light DOM (no shadow root) and the host element is what assistive technology and selectors see.

class, style, id

Applied to the host element as usual. Use extra-class instead of class if you need the class on the inner rendered element (the <hr> or wrapping <div>) rather than the host.

Notes

The following notes are applicable of this component.

Built-in accessibility

  • With no label, aegov-separator renders a real native <hr> — inherently correct semantics with zero ARIA needed for the plain case.
  • Defaults to role="presentation" (is-decorative defaults to true), so a purely visual divider generates no noise for screen readers.
  • Setting is-decorative="false" exposes role="separator" instead, so assistive technology announces it as a real structural divider.
  • aria-orientation is set to match orientation, but only when the separator's role is separator — it's correctly omitted entirely when the role is presentation, since aria-orientation isn't meaningful on an element assistive technology is told to ignore.
  • Supplying text (or slotted content) always forces role="separator", even if is-decorative is left at its default true — 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 in extra-class has 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 separator as presentational. Convey the meaning in surrounding text or headings, and mark an icon used as a label aria-hidden="true".
  • Keep label text short — a long label in a text-bearing separator can wrap awkwardly on narrow viewports.