Skip to content
DGA UI

Featured Icon

An icon in a tinted container that leads cards, empty states and dialogs. Light, hard and outlined, six colours.

On this page

A featured icon draws attention to a card, an empty state or a dialog, and hints at its meaning with colour.

Featured Icon
featured-icon-direction
featured-icon-theme
featured-icon-viewport
Mobile · 375px

Not in the DGA Figma file

The featured icon comes from the design.dga.gov.sa CSS. Its tokens are added from the site CSS and listed under Deviations.

Installation

npx shadcn@latest add @dga/featured-icon

Usage

page.tsx
import { CheckmarkCircle02Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import { FeaturedIcon } from "@/components/ui/featured-icon";

<FeaturedIcon variant="success">
  <HugeiconsIcon icon={CheckmarkCircle02Icon} />
</FeaturedIcon>

Props

Prop

Type

Accessibility

  • Decorative by default (aria-hidden), because the text next to it carries the meaning.
  • If the icon alone carries meaning, pass role="img" and an aria-label; it is then announced.
  • Icons are checked at 3:1 against their fill and the page surface.

Contrast

108 pairs checked against WCAG 2.1 AA (text 4.5:1, icons and focus rings 3:1), all passing. Disabled states are exempt.

brand
StateForeground on backgroundLightDark
hardicon-oncolor / featured-icon-brand-background4.74:1 3:14.74:1 3:1
lightfeatured-icon-brand-icon / featured-icon-brand-background-light4.53:1 3:19.16:1 3:1
outlinedfeatured-icon-brand-icon / background-white4.54:1 3:18.63:1 3:1
neutral
StateForeground on backgroundLightDark
hardicon-oncolor / featured-icon-neutral-background4.77:1 3:14.77:1 3:1
lightfeatured-icon-neutral-icon / featured-icon-neutral-background-light4.34:1 3:19.95:1 3:1
outlinedfeatured-icon-neutral-icon / background-white4.57:1 3:19.95:1 3:1
success
StateForeground on backgroundLightDark
hardicon-oncolor / featured-icon-success-background5.69:1 3:15.69:1 3:1
lightfeatured-icon-success-icon / featured-icon-success-background-light5.39:1 3:18.63:1 3:1
outlinedfeatured-icon-success-icon / background-white5.44:1 3:18.98:1 3:1
error
StateForeground on backgroundLightDark
hardicon-oncolor / featured-icon-error-background4.83:1 3:14.83:1 3:1
lightfeatured-icon-error-icon / featured-icon-error-background-light4.44:1 3:17.18:1 3:1
outlinedfeatured-icon-error-icon / background-white4.62:1 3:17.48:1 3:1
warning
StateForeground on backgroundLightDark
hardicon-oncolor / featured-icon-warning-background5.42:1 3:15.42:1 3:1
lightfeatured-icon-warning-icon / featured-icon-warning-background-light5.20:1 3:19.02:1 3:1
outlinedfeatured-icon-warning-icon / background-white5.19:1 3:19.39:1 3:1
info
StateForeground on backgroundLightDark
hardicon-oncolor / featured-icon-info-background4.56:1 3:14.56:1 3:1
lightfeatured-icon-info-icon / featured-icon-info-background-light4.25:1 3:17.98:1 3:1
outlinedfeatured-icon-info-icon / background-white4.37:1 3:18.21:1 3:1

Deviations from DGA

ItemDGA originalOursReason
--featured-icon-brand-background (new)Added from site CSS (.featured-icon)--colors-primary-sa-flag-600-primaryFeatured icon brand hard fill (white icon): primary-sa-flag-600.
--featured-icon-brand-background-light (new)Added from site CSS (.featured-icon)--colors-primary-sa-flag-50 (light), --colors-primary-sa-flag-950 (dark)Featured icon brand light fill: primary-sa-flag-50, primary-sa-flag-950 in dark mode.
--featured-icon-brand-icon (new)Added from site CSS (.featured-icon)--colors-primary-sa-flag-600-primary (light), --colors-primary-sa-flag-300 (dark)Featured icon brand icon on the light fill and outlined: primary-sa-flag-600, primary-sa-flag-300 in dark mode.
--featured-icon-brand-border (new)Added from site CSS (.featured-icon)--colors-primary-sa-flag-200 (light), --colors-primary-sa-flag-800 (dark)Featured icon brand outlined border: primary-sa-flag-200, primary-sa-flag-800 in dark mode.
--featured-icon-neutral-background (new)Added from site CSS (.featured-icon)--colors-neutral-500Featured icon neutral hard fill (white icon): neutral-500.
--featured-icon-neutral-background-light (new)Added from site CSS (.featured-icon)--colors-neutral-100 (light), --colors-neutral-800 (dark)Featured icon neutral light fill: neutral-100, neutral-800 in dark mode.
--featured-icon-neutral-icon (new)Added from site CSS (.featured-icon)--colors-neutral-500 (light), --colors-neutral-300 (dark)Featured icon neutral icon on the light fill and outlined: neutral-500, neutral-300 in dark mode.
--featured-icon-neutral-border (new)Added from site CSS (.featured-icon)--colors-neutral-200 (light), --colors-neutral-700 (dark)Featured icon neutral outlined border: neutral-200, neutral-700 in dark mode.
--featured-icon-success-background (new)Added from site CSS (.featured-icon)--colors-green-700Featured icon success hard fill (white icon): green-700.
--featured-icon-success-background-light (new)Added from site CSS (.featured-icon)--colors-green-50 (light), --colors-green-950 (dark)Featured icon success light fill: green-50, green-950 in dark mode.
--featured-icon-success-icon (new)Added from site CSS (.featured-icon)--colors-green-700 (light), --colors-green-300 (dark)Featured icon success icon on the light fill and outlined: green-700, green-300 in dark mode.
--featured-icon-success-border (new)Added from site CSS (.featured-icon)--colors-green-200 (light), --colors-green-800 (dark)Featured icon success outlined border: green-200, green-800 in dark mode.
--featured-icon-error-background (new)Added from site CSS (.featured-icon)--colors-red-600Featured icon error hard fill (white icon): red-600.
--featured-icon-error-background-light (new)Added from site CSS (.featured-icon)--colors-red-50 (light), --colors-red-950 (dark)Featured icon error light fill: red-50, red-950 in dark mode.
--featured-icon-error-icon (new)Added from site CSS (.featured-icon)--colors-red-600 (light), --colors-red-300 (dark)Featured icon error icon on the light fill and outlined: red-600, red-300 in dark mode.
--featured-icon-error-border (new)Added from site CSS (.featured-icon)--colors-red-200 (light), --colors-red-800 (dark)Featured icon error outlined border: red-200, red-800 in dark mode.
--featured-icon-warning-background (new)Added from site CSS (.featured-icon)--colors-yellow-700Featured icon warning hard fill (white icon): yellow-700.
--featured-icon-warning-background-light (new)Added from site CSS (.featured-icon)--colors-yellow-50 (light), --colors-yellow-950 (dark)Featured icon warning light fill: yellow-50, yellow-950 in dark mode.
--featured-icon-warning-icon (new)Added from site CSS (.featured-icon)--colors-yellow-700 (light), --colors-yellow-300 (dark)Featured icon warning icon on the light fill and outlined: yellow-700, yellow-300 in dark mode.
--featured-icon-warning-border (new)Added from site CSS (.featured-icon)--colors-yellow-200 (light), --colors-yellow-800 (dark)Featured icon warning outlined border: yellow-200, yellow-800 in dark mode.
--featured-icon-info-background (new)Added from site CSS (.featured-icon)--colors-blue-600Featured icon info hard fill (white icon): blue-600.
--featured-icon-info-background-light (new)Added from site CSS (.featured-icon)--colors-blue-50 (light), --colors-blue-950 (dark)Featured icon info light fill: blue-50, blue-950 in dark mode.
--featured-icon-info-icon (new)Added from site CSS (.featured-icon)--colors-blue-600 (light), --colors-blue-300 (dark)Featured icon info icon on the light fill and outlined: blue-600, blue-300 in dark mode.
--featured-icon-info-border (new)Added from site CSS (.featured-icon)--colors-blue-200 (light), --colors-blue-800 (dark)Featured icon info outlined border: blue-200, blue-800 in dark mode.
Featured IconNot in the DGA Figma file. Defined only in the design.dga.gov.sa CSS (.featured-icon).Built from the site CSS: hard, light and outlined; brand, neutral, success, error, warning and info; sm 32, md 40, lg 48 and xl 56px; square or circle.Figma is the source of truth where it exists; here only the site CSS does.
Featured Icon: hard warning and successHard warning: white on warning-400. Hard success: white on brand-600 (the same as brand).Hard warning uses yellow-700; hard success uses green-700 (DGA status green).White on yellow-400 is 1.9:1, below the 3:1 non-text minimum. Success uses the status palette so it differs from brand, as the site's semantic block (text-success) does.
Edit this page on GitHub (opens in a new tab)