Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-material-symbols

ed-software30.1kApache-2.04.4.0TypeScript support: included

A simple package for adding Material Symbols to any React project.

Icons, React, TypeScript, Material Icons, Material Symbols, Symbols, Material

readme

React Material Symbols NodeJS CI Publish Release

A simple package for adding Material Symbols to any React project.

foo

Authors

Installation

Install with npm

  npm i react-material-symbols

Props

type MaterialSymbolProps

Prop Type Description
icon '10k' | '10mp' | ... 2368 more ... | 'zoom_out_map' Required. The name of the icon to render.
fill boolean | undefined Default false. Fill gives you the ability to modify the default icon style. A single icon can render both unfilled and filled states.
weight 100 | 200 | ... 6 more ... | 900 | undefined Default inherit. Weight defines the symbol’s stroke weight, with a range of weights between thin (100) and heavy (900). Weight can also affect the overall size of the symbol.
grade number | undefined Default inherit. Weight and grade affect a symbol’s thickness. Adjustments to grade are more granular than adjustments to weight and have a small impact on the size of the symbol.
size number | undefined Default inherit. Size defines the icon width and height in pixels. For the image to look the same at different sizes, the stroke weight (thickness) changes as the icon size scales.
color string | undefined Default inherit. Color accepts key values ('red', 'blue', 'indigo', etc.), <hex-color>, <rgb()>, <hsl()> and <hwb()> values.
as React.ElementType | undefined Default 'span'. Set the HTML Element for the icon.

Examples

import { MaterialSymbol } from 'react-material-symbols';
import 'react-material-symbols/rounded'; // Place in your root app file. There are also `sharp` and `outlined` variants.

export default function App() {
  return (
    <MaterialSymbol icon="folder" size={24} fill grade={-25} color='red' />
  )
}

Demo

https://react-material-symbols.vercel.app/

License

Material Symbols are created by Google.

We have made these icons available for you to incorporate into your products under the Apache License Version 2.0. Feel free to remix and re-share these icons and documentation in your products. We'd love attribution in your app's about screen, but it's not required.

changelog

Changelog

4.4.0 (2024-03-12)

Features

  • Expose MaterialSymbolWeight, SymbolCodepoints interfaces (80a2416)

4.3.1 (2023-11-20)

Bug Fixes

4.3.0 (2023-11-20)

Features

  • :bug: fix compatibility with next 13 (9d5ebd2)

Bug Fixes

  • update icons to November 2023 (2ecc897)

4.2.2 (2023-10-18)

Bug Fixes

4.2.1 (2023-10-18)

Bug Fixes

4.2.0 (2023-10-18)

Features

  • :sparkles: update icons (9155044)

Bug Fixes

  • :bug: file extension mismatch (af26a2a)

4.1.3 (2023-10-18)

Bug Fixes

4.1.2 (2023-10-18)

Bug Fixes

  • :bug: update dependencies to peer dependencies (2020d83)

4.1.1 (2023-04-28)

Bug Fixes

  • :construction_worker: update storybook (a0b2fba)

4.1.0 (2023-04-28)

Features

  • :sparkles: add ref support (0b99f44)

4.0.2 (2023-04-03)

Bug Fixes

  • :bug: icons should show nothing until the font is loaded (69257b0)

4.0.1 (2023-03-19)

Bug Fixes

  • :bug: missing npm token from ci (fe2ed31)
  • :memo: update docs (e30b000)

4.0.0 (2023-03-19)

⚠ BREAKING CHANGES

  • :sparkles: refactor library away from font and css injection to improve flexibility and performance

Features

  • :sparkles: refactor library away from font and css injection to improve flexibility and performance (48c0166)

3.0.2 (2023-03-18)

Bug Fixes

  • :bug: add declaration map to tsconfig (2da0f0d)

3.0.1 (2023-03-17)

Bug Fixes

  • :bug: Fixed missing class on icon component due to css modules update (4cc0022)

3.0.0 (2023-03-10)

⚠ BREAKING CHANGES

  • :sparkles: update icons

Features

  • :sparkles: update icons (1527e62)

Bug Fixes

  • :bug: support node versions past 14 (a5fa1e5)

2.0.4 (2023-03-10)

Bug Fixes

  • :arrow_up: update dependencies (1b3dd79)

2.0.3 (2023-03-10)

Bug Fixes

  • widen package version range to avoid "Unsupported engine" warning (47011ad)

2.0.2 (2022-11-28)

Bug Fixes

2.0.1 (2022-11-28)

Bug Fixes

2.0.0 (2022-11-28)

⚠ BREAKING CHANGES

  • sparkles: update import API

Features

  • sparkles: update import API (9281562)

Bug Fixes

  • :bug: remove unneeded dependencies (825d9e6)

1.0.4 (2022-11-27)

Bug Fixes

  • :bug: missing type declarations (177375e)

1.0.3 (2022-11-25)

Bug Fixes

  • :bug: make grade and size props accept numbers (c8ff068)

1.0.2 (2022-11-25)

Bug Fixes

  • :scroll: documentation updates (bd1482e)

1.0.1 (2022-11-25)

Bug Fixes

  • :bug: repair broken package (21e3510)

1.0.0 (2022-11-25)

Features

  • :sparkles: add MaterialIcon component (07a8ef0)