Icon

Renders a bundled GitLab SVG icon with consistent sizing and semantic color.

On this page

This docs is LLM-friendly and available as clean Markdown.

Supported browser agents can also use WebMCP to search, read, and open these docs. Learn more

Usage

import { GlIcon } from "gitlab-ui-react/icon";
<GlIcon name="information-o" />

Default

Icons are decorative by default and inherit the current text color. Pair an icon with visible text whenever the symbol alone may be ambiguous.

Icon with text
Additional information

Sizes

Choose a supported size that matches the surrounding control or content. Avoid resizing icons with arbitrary CSS dimensions.

Icon sizes

Semantic variants

Use a semantic color only when the icon must differ from its parent’s text color. Do not rely on color alone to communicate meaning.

Semantic icon variants

Accessibility

  • Decorative icons are automatically hidden from assistive technology.
  • For a standalone informational icon, provide ariaLabel or native aria-label with the meaning conveyed by the icon.
  • Do not make GlIcon itself clickable. Put interactive icons inside a semantic button or link with an accessible name.
  • Use the same icon consistently for the same concept or action.

API

GlIcon also forwards supported SVG attributes to the rendered <svg> element.

Prop Description Default
name Selects an icon bundled from @gitlab/svgs.
size Sets the icon to 8, 12, 14, 16, 24, 32, 48, or 72 pixels. 16
variant Sets current, default, subtle, strong, disabled, link, info, warning, danger, or success color. "current"
ariaLabel Gives a non-decorative icon an accessible name.