Icon

271 icons · 16 × 16 · click one to download its SVG

Icons beside words

Every drawing occupies a square, with its lower edge on the text line.

Real library icons

Each drawing is selected with the type attribute.

Glyph, primary and secondary

The same drawing in three treatments.

AttributeTypeDefaultWhat it does
typestringEmptyFile name from DS1/x-icon/, without .svg.
variantglyph, primary, secondaryglyphPlain drawing or a background treatment.

Use type="check", not name="check". There is no size attribute. The drawing follows the system’s --sf scale. Use --icon-color when a control needs a different ink.

A decorative icon beside text can have aria-hidden="true". Give an icon-only button an accessible name on its actual button. A tooltip supplements that name; it is not a replacement for it.

The source files live in DS1/x-icon/. Add missing drawings to that library first, then generate the runtime map and public collection. Products carry the icons they use as local files.

ds-icon draws the most common icons at once and loads the rest in one deferred chunk the first time one is asked for. A component that always draws one icon ships that drawing with itself through provideIcons({ name: svg }), as ds-avatar does with its person, so it never waits for the chunk.

Every country has its flag, in DS1/x-flag/ by its two-letter code in lower case (ie.svg, jp.svg, gb-sct.svg for a nation of the UK), so a page can show where people are from. They are not listed here. Each is 3:2, drawn as an <img> with .ds-flag from controls.css: one control high, 12px with .ds-flag--small, corners a quarter of its height, a hairline in the fill’s grey on its edge, standing on the line’s sixteen with the words 4px after it; in a table row it stands in the middle, clear of the row’s lines.

<img class="ds-flag" src="flags/ie.svg" alt=""> Dublin, Ireland

A product copies them with Sync 1’s flags export: "flags": ["jp", "dk"], or true for every one when the country is not known in advance. The drawings are country-flag-icons’ (MIT, licence beside them); Japan’s is Ezo’s.

Button · Tooltip · All components