Navigation

v1.0.0
Frameworks

SVG and JavaScript

Use icons without a framework dependency.

On this page

#SVG files

Download a single SVG from the collection, or a ZIP archive of every icon for one size and corner style, together with their licenses. After installing @master/icons, the same files are available at the package subpath @master/icons/svg/{size}/{corner}/{name}.svg, such as @master/icons/svg/20/soft/search.svg.

Inline SVG uses currentColor. An external SVG loaded through <img> does not inherit the surrounding text color.

#JavaScript renderer

import { Search, renderSvg } from '@master/icons';const svg = renderSvg(Search, { size: 20, corner: 'soft', label: 'Search' });

renderSvg returns SVG markup. Use it with this package's trusted icon definitions. Icon definitions are named without the Icon suffix used by components. The size option controls display size; opticalSize can select 16, 20 or 24 explicitly. By default, the closest optical drawing is selected.

OptionDefaultBehavior
size24Display size, a positive finite number
opticalSize'auto'The 16, 20 or 24 master; auto picks the nearest, and the larger one at 18 and 22
corner'soft''sharp', 'soft' or 'rounded'
strokeWidthnativeA stroke width in native units and steps of 0.25
color'currentColor'The color of the drawing
labelnoneWithout it the SVG is aria-hidden; with it the SVG gets role="img" and the label
direction'ltr''rtl' mirrors directional icons

Only arrow-left, arrow-right, chevron-left, chevron-right, chevrons-left, chevrons-right, undo and redo mirror when direction is rtl.