npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

material-symbols-expo

v5.2.21

Published

Material Symbols icon set for Expo.

Downloads

1,986

Readme

Expo Icon Sets for Material Symbols

Easily integrate Material Symbols icons into your Expo projects with this library. It leverages @expo/vector-icons and provides pre-configured icon sets for seamless usage.

This library converts variable font files from Material Design Icons into static font files by removing the GRAD, opsz, and wght axes. It supports the FILL axis with two values: 0 (outline) and 1 (filled). These font variants are packaged as icon sets using Expo’s createIconSet.

Features

  • Predefined Variants: Includes outlined, rounded, sharp, and their filled versions.
  • Convenient API: A single component to configure variants, size, fill, and color.
  • Optimized for Expo: Fonts are bundled and compatible with the Expo ecosystem.

Installation

Install the library using npm:

npm install material-symbols-expo

Setup

Depending on your project setup, you can load font assets with useFonts or expo-font in your app.config file.

Using useFonts

import { useFonts } from "expo-font";
import { MaterialSymbolsFonts } from "material-symbols-expo";

const [fontsLoaded] = useFonts({
	...MaterialSymbolsFonts,
	...OtherFonts, // Include your other font assets here
});

Using expo-font

Configure font assets in your app.config.mjs:

// app.config.mjs
import { MaterialSymbolsFontPaths } from "material-symbols-expo";

export default {
	expo: {
		plugins: [
			[
				"expo-font",
				{
					fonts: [...MaterialSymbolsFontPaths]
				}
			]
		]
	}
};

Note: Ensure your app.config uses the .mjs extension to support ES Modules. Importing MaterialSymbolsFonts without it will result in an error.

Importing individual variants

You're not required to load all font assets at once. You can import specific variants as needed to reduce bundle size.

Using useFonts


import { useFonts } from "expo-font";
import { MaterialSymbolsOutlinedFontAsset, MaterialSymbolsOutlinedFilledFontAsset } from "material-symbols-expo";

const [fontsLoaded] = useFonts({
	...MaterialSymbolsOutlinedFontAsset,
	...MaterialSymbolsOutlinedFilledFontAsset,
	...OtherFonts // Include your other font assets here
});

Using expo-font

// app.config.mjs
import { MaterialSymbolsOutlinedFontPath, MaterialSymbolsOutlinedFilledFontPath } from "material-symbols-expo";

export default {
	expo: {
		plugins: [
			[
				"expo-font",
				{
					fonts: [
						MaterialSymbolsOutlinedFontPath,
						MaterialSymbolsOutlinedFilledFontPath
					]
				}
			]
		]
	}
};

Usage

1. Simplified Component

Use the MaterialSymbols component to specify variants, size, fill, and color directly:

import { MaterialSymbols } from "material-symbols-expo";

<MaterialSymbols
	name="account_circle" // Required
	variant="rounded"     // Optional: outlined (default), rounded, sharp
	size={24}             // Optional: Default is 24
	color="#000"          // Optional: Default is "currentColor"
	filled={true}         // Optional: Default is false
/>

2. Direct Variant Imports

You can also import specific icon variants directly:

import { MaterialSymbolsOutlined, MaterialSymbolsRoundedFilled } from "material-symbols-expo";

// Outlined variant
<MaterialSymbolsOutlined
	name="account_circle"
	size={24}
	color="#000"
/>

// Rounded + Filled variant
<MaterialSymbolsRoundedFilled
	name="account_circle"
	size={24}
	color="#000"
/>

Variants

This library includes the following icon styles:

  • Outlined: MaterialSymbolsOutlined
  • Rounded: MaterialSymbolsRounded
  • Sharp: MaterialSymbolsSharp
  • Filled Variants:
  • Outlined + Fill: MaterialSymbolsOutlinedFilled
  • Rounded + Fill: MaterialSymbolsRoundedFilled
  • Sharp + Fill: MaterialSymbolsSharpFilled

License

This library utilizes Material Symbols under the Apache License 2.0. Ensure compliance with the terms when using the icons.