Anatomy
The aegov-badge component renders a single inline <span> element containing the slotted label. An optional leading icon can be slotted before the text, and an optional trailing dismiss button is rendered when is-dismissible is set.

| Item | Name | Description |
|---|---|---|
1 |
Icon (optional) | An inline SVG or image slotted before the label to reinforce meaning visually |
2 |
Label | The slotted text content of the badge |
3 |
Dismiss button (optional) | Rendered when is-dismissible is true; emits aegovBadgeDismiss on click |
Options
The badge has options for different use cases. These are considered the basic properties that are applicable to a badge.
Appearance
The appearance property switches between two styles. soft (default) uses a tinted background with a darker, full-saturation label — quieter, suitable for tables and list rows. solid uses a fully filled colour panel with white text — louder, suitable for emphasised counters or critical statuses.
Color palette
The variant property accepts every token in the UAE Design System palette. Use the brand colours (default, primary, secondary, aegold, aered, aegreen, aeblack) for status that aligns with platform identity, and the accent colours (techblue, seablue, camel, desert, fuchsia, slate, purple, pink, indigo, lime) for richer category tagging — 17 tokens in total.
Size
The size property controls the font size, padding, and corner radius of a badge.
| Token | Font | Padding | Radius |
|---|---|---|---|
sm |
text-xs |
py-0.5 px-1.5 |
rounded-sm |
base |
text-sm |
py-0.5 px-1.5 |
rounded-md |
lg |
text-sm |
py-1 px-2 |
rounded-md, font-medium |
<aegov-badge size="sm" variant="primary">Small</aegov-badge>
<aegov-badge size="base" variant="primary">Base</aegov-badge>
<aegov-badge size="lg" variant="primary">Large</aegov-badge>
import { AegovBadge } from '@aegov/designsystem-react';
export default function BadgeSizes() {
return (
<>
<AegovBadge size="sm" variant="primary">Small</AegovBadge>
<AegovBadge size="base" variant="primary">Base</AegovBadge>
<AegovBadge size="lg" variant="primary">Large</AegovBadge>
</>
);
}
<template>
<aegov-badge size="sm" variant="primary">Small</aegov-badge>
<aegov-badge size="base" variant="primary">Base</aegov-badge>
<aegov-badge size="lg" variant="primary">Large</aegov-badge>
</template>
import { Component } from '@angular/core';
import { AegovBadge } from '@aegov/designsystem-angular';
@Component({
selector: 'app-badge-sizes',
imports: [AegovBadge],
template: `
<aegov-badge size="sm" variant="primary">Small</aegov-badge>
<aegov-badge size="base" variant="primary">Base</aegov-badge>
<aegov-badge size="lg" variant="primary">Large</aegov-badge>
`,
})
export class BadgeSizesComponent {}
Responsive size
size can also be set per breakpoint using a responsive string. Only the three tokens above — sm, base, lg — are valid values at any breakpoint. Pick a value to preview what it resolves to.
<aegov-badge size="sm md:base xl:lg" variant="techblue">
Resizes with the viewport
</aegov-badge>
import { AegovBadge } from '@aegov/designsystem-react';
export default function ResponsiveBadge() {
return (
<AegovBadge size="sm md:base xl:lg" variant="techblue">
Resizes with the viewport
</AegovBadge>
);
}
<template>
<aegov-badge size="sm md:base xl:lg" variant="techblue">
Resizes with the viewport
</aegov-badge>
</template>
import { Component } from '@angular/core';
import { AegovBadge } from '@aegov/designsystem-angular';
@Component({
selector: 'app-responsive-badge',
imports: [AegovBadge],
template: `
<aegov-badge size="sm md:base xl:lg" variant="techblue">
Resizes with the viewport
</aegov-badge>
`,
})
export class ResponsiveBadgeComponent {}
Icons
The default slot accepts any inline content, including SVG icons placed before the label.
Leading icon
Place an icon before the label to reinforce meaning visually. Icons are sized automatically per badge size — size-3 for sm, size-3.5 for base, and size-4 for lg — so no width/height needs to be declared. Mark decorative icons with aria-hidden="true" so screen readers read only the text label.
<aegov-badge variant="aegreen">
<svg aria-hidden="true">...</svg>
Active
</aegov-badge>
Dismissible badge
Set is-dismissible to render a close button at the trailing edge of the badge. Clicking it emits the aegovBadgeDismiss event. The badge does not remove itself from the DOM — your application decides what to do, most commonly removing the host element from a list of active filters.
<div class="flex flex-wrap items-center gap-2">
<aegov-badge variant="techblue" is-dismissible>Abu Dhabi</aegov-badge>
<aegov-badge variant="techblue" is-dismissible>Dubai</aegov-badge>
<aegov-badge variant="techblue" is-dismissible>Sharjah</aegov-badge>
</div>
<script>
document.querySelectorAll('aegov-badge[is-dismissible]').forEach(b => {
b.addEventListener('aegovBadgeDismiss', () => b.remove());
});
</script>
import { useState } from 'react';
import { AegovBadge } from '@aegov/designsystem-react';
export default function DismissibleBadges() {
const [regions, setRegions] = useState(['Abu Dhabi', 'Dubai', 'Sharjah']);
return (
<div className="flex flex-wrap items-center gap-2">
{regions.map((region) => (
<AegovBadge
key={region}
variant="techblue"
isDismissible
onAegovBadgeDismiss={() => setRegions((r) => r.filter((x) => x !== region))}
>
{region}
</AegovBadge>
))}
</div>
);
}
<template>
<div class="flex flex-wrap items-center gap-2">
<aegov-badge
v-for="region in regions"
:key="region"
variant="techblue"
is-dismissible
@aegovBadgeDismiss="regions = regions.filter((r) => r !== region)"
>
{{ region }}
</aegov-badge>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const regions = ref(['Abu Dhabi', 'Dubai', 'Sharjah']);
</script>
import { Component } from '@angular/core';
import { AegovBadge } from '@aegov/designsystem-angular';
@Component({
selector: 'app-dismissible-badges',
imports: [AegovBadge],
template: `
<div class="flex flex-wrap items-center gap-2">
@for (region of regions; track region) {
<aegov-badge variant="techblue" [isDismissible]="true" (aegovBadgeDismiss)="remove(region)">
{{ region }}
</aegov-badge>
}
</div>
`,
})
export class DismissibleBadgesComponent {
regions = ['Abu Dhabi', 'Dubai', 'Sharjah'];
remove(region: string) {
this.regions = this.regions.filter((r) => r !== region);
}
}
Common uses
A common use for a badge is to mark the status of a row in a service list, or as a numerical counter next to a navigation item.
-
Emirates ID renewal
Active -
Driving licence transfer
Pending -
Vehicle registration
Expired
Status indicators
Pair colours consistently across your application so users learn the meaning at a glance — for example, always use aegreen for active states and aered for errors or expiry.
Counters
Small solid badges work well as numerical counters next to navigation items, tabs, or icons. Use size="sm" for the most common counter footprint, and add visually hidden text (for example <span class="sr-only">unread messages</span>) so the count is announced in context — an aria-label on the badge is not reliably announced.
RTL support
The badge is direction-agnostic. The dismiss button's spacing flips based on dir="rtl", so in an RTL container it automatically renders on the inline-end (visually the left side). No extra configuration is required — pass real Arabic content into the slot and the layout flips correctly.
<div dir="rtl">
<aegov-badge variant="aegreen">نشِط</aegov-badge>
<aegov-badge variant="camel">قيد الانتظار</aegov-badge>
<aegov-badge variant="techblue" is-dismissible>تصنيف: أبوظبي</aegov-badge>
</div>
import { AegovBadge } from '@aegov/designsystem-react';
export default function RtlBadges() {
return (
<div dir="rtl">
<AegovBadge variant="aegreen">نشِط</AegovBadge>
<AegovBadge variant="camel">قيد الانتظار</AegovBadge>
<AegovBadge variant="techblue" isDismissible>تصنيف: أبوظبي</AegovBadge>
</div>
);
}
<template>
<div dir="rtl">
<aegov-badge variant="aegreen">نشِط</aegov-badge>
<aegov-badge variant="camel">قيد الانتظار</aegov-badge>
<aegov-badge variant="techblue" is-dismissible>تصنيف: أبوظبي</aegov-badge>
</div>
</template>
import { Component } from '@angular/core';
import { AegovBadge } from '@aegov/designsystem-angular';
@Component({
selector: 'app-rtl-badges',
imports: [AegovBadge],
template: `
<div dir="rtl">
<aegov-badge variant="aegreen">نشِط</aegov-badge>
<aegov-badge variant="camel">قيد الانتظار</aegov-badge>
<aegov-badge variant="techblue" [isDismissible]="true">تصنيف: أبوظبي</aegov-badge>
</div>
`,
})
export class RtlBadgesComponent {}
Usage
Here is the recommended usage of a badge 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.
Pair colour with explicit text
Colour alone is not sufficient to convey status. Always label the badge with a word such as "Active" or "Suspended" so meaning does not depend on colour perception alone.
Keep colour meaning consistent
Assign one colour per status meaning across the whole application (for example, aegreen always means active) and keep that mapping consistent on every screen so users learn it once.
Do not use a badge as a button
A badge is not an interactive control on its own — only its optional dismiss button is interactive. Do not attach click handlers to the whole badge for navigation or actions; use aegov-button or aegov-link instead.
Do not overuse the solid appearance
The solid appearance is louder and reserved for emphasised counters or critical statuses. Using it everywhere reduces visual hierarchy and makes true priorities harder to spot.
Do not stuff long sentences into a badge
Badges are meant to be compact. Keep the label to a short word or count; move longer explanations into surrounding content or a tooltip.
API reference
The following are the properties and references of a badge
aegov-badge default properties
| Attribute | Description | Type | Default |
|---|---|---|---|
| DOM id for the inner <span> element. Auto-generated as |
| auto-generated |
| Colour token from the UAE Design System palette. |
|
|
| Visual style — tinted background, or a fully filled panel. |
|
|
| Size token. Accepts a single token or a Tailwind-style responsive string. |
|
|
| Renders a close button at the trailing edge of the badge. |
|
|
Events
| Events | Description | Component | Detail |
|---|---|---|---|
| Fired when the dismiss button is clicked. The badge does not remove itself from the DOM. | aegov-badge |
|
<aegov-badge field-id="filter-region" variant="techblue" is-dismissible>
Region: Abu Dhabi
</aegov-badge>
<script>
document.querySelector('#filter-region').addEventListener('aegovBadgeDismiss', () => {
document.querySelector('#filter-region').remove();
});
</script>
Slots
| Slot | Description |
|---|---|
(default) | The badge label. Plain text or simple inline HTML, including a leading icon. |
Pass-through attributes
| Attribute | Notes | Forwards to |
|---|---|---|
| Any aria tag not automatically added. Copied to the inner | inner |
| Any custom "data" attribute. Useful for analytics or styling hooks. | inner |
| Use | n/a |
Notes
The following notes are applicable of this component.
Built-in accessibility
- The dismiss button is a real
<button type="button">, so it is focusable, keyboard-activatable, and exposed correctly to assistive technologies by default. - The dismiss button's
aria-labelis context-aware — it automatically includes the badge's text content, so screen readers announce "Dismiss Approved", "Dismiss Error", etc. rather than a generic label. The text is read once, when the badge first loads — if the label changes afterwards, the dismiss label keeps the original text, so re-create the badge rather than editing its text in place. When the badge has no text it falls back to "Dismiss badge" ("إغلاق الشارة" in RTL). - The dismiss button maintains a minimum touch target of 24 × 24 CSS px on every badge size (sm, base, lg), satisfying WCAG SC 2.5.8.
- The dismiss SVG icon is
aria-hidden="true"— all meaning is carried by the button'saria-label. - The dismiss-click handler calls
event.stopPropagation(), so a parent click handler does not also fire when a badge is dismissed. aria-*anddata-*attributes set on the host are forwarded to the inner<span>.
Developer responsibility
The following is required for a developer to add additionally or pay attention to regarding this component.
- Provide meaningful text inside the badge. Colour alone is not sufficient to convey status — pair colour with explicit words such as "Active", "Pending", or "Suspended".
- For badges acting as numerical counters, give the count its context in text, for example
<aegov-badge>3 <span class="sr-only">unread messages</span></aegov-badge>. Anaria-labelon the host is copied to a role-less<span>, and screen readers do not reliably announce names on elements without a role. - After a dismiss, remove the badge and move focus to a sensible element (the next badge, or the filter group) — the focused dismiss button disappears with it.
- If a badge's value changes over time, consider wrapping it (or its surrounding container) in an
aria-live="polite"region so assistive technology announces the update. - Removing the badge from the DOM after dismiss is the consumer's responsibility — the component emits
aegovBadgeDismissbut does not auto-remove itself. - Mark decorative inline icons with
aria-hidden="true". The badge text is the sole accessible label.
Additional notes
- Icons placed inside the slot inherit sizing automatically based on the
sizeprop — you do not need to set width/height on the icon. Tabmoves focus to the dismiss button when present;EnterorSpaceactivates it. A non-dismissible badge is not focusable and is not part of the tab order.