All system icons are inline SVG files, invoked via a Razor helper. The helper will insert a properly formatted and minified SVG file into your view. All icons are managed and stored within the Icons repository.

Using the icon helpers

Our icons are delivered as a Razor helper in Stack Overflow’s production environment, a custom liquid tag in our documentation’s Eleventy site generator, and a JavaScript helper for use in prototypes.

Helpers should be used for all icons in lieu of SVG sprite sheets or raster image assets. This ensures a single source of truth for all icons.


<!-- Razor -->

<!-- Liquid -->
{% icon "Logo" %}

<!-- JavaScript Helper -->
<svg data-icon="Logo"></svg>

Native colors

By default, every icon will inherit the text color of its parent. To override this and show the icon with its native colors (Our logos, for example), you can include the native class in the helper.

<!-- Razor -->

<!-- Liquid -->
{% icon "Logo", "native" %}

<!-- JavaScript Helper -->
<svg data-icon="Logo" class="native"></svg>

Arbitrary classes

In fact, our helper supports arbitrary classes as well.

<!-- Razor -->
@Svg.Logo.With("native float-right js-dropdown-target")

<!-- Liquid -->
{% icon "Logo", "native float-right js-dropdown-target" %}

<!-- JavaScript Helper -->
<svg data-icon="Logo" class="native float-right js-dropdown-target"></svg>

Requesting an icon

If an icon you need isn’t here, please do one of the following two options:

  1. Submit a request outlining the desired icon, the icon’s intended purposed, and where it will be used.
  2. If the icon is ready, submit a pull request to have it to be reviewed. Please be sure to provide the same information as above.

If you have further questions, visit the project’s Slack channel: #stacks.

Icon set