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

react-native-sfsymbol

v0.3.0

Published

My new module

Downloads

13

Readme

react-native-sfsymbol

NOTE: This library is under development, so the API may change until it hits v1.0.0.

SF Symbols are a set of over 2,500 consistent, highly configurable symbols you can use in your app. SF Symbols are designed to integrate seamlessly with the San Francisco system font, so the symbols automatically ensure optical vertical alignment with text for all weights and sizes.

Highlights

Installation

Add the package as a dependency

yarn add react-native-sfsymbol

Then run

npx pod-install

NOTE: This library works with bare React Native and Expo managed apps. It will not work with Expo Go.

Usage

import { useState } from "react";
import { View, Button } from "react-native";
import { SFSymbol } from "react-native-sfsymbol";

export default function App() {
  const [volume, setVolume] = useState(0);
  return (
    <View style={styles.container}>
      {/* Monochrome rendering mode (one color) */}
      <SFSymbol
        name="heart"
        color="#FF3B30FF"
        weight="bold"
        size={100}
        scale="small"
      />
      {/* Hierarchical rendering mode (one color with opacities), with a varaible value */}
      <SFSymbol
        name="speaker.wave.3"
        renderingMode="hierarchical"
        scale="medium"
        variableValue={volume}
        size={100}
      />
      <Button title="Volume Up" onPress={() => setVolume(volume + 0.1)} />
      {/* Palette rendering mode (multiple custom colors) */}
      <SFSymbol
        name="person.2"
        renderingMode="palette"
        color={["#FF3B30FF", "#007AFFFF"]}
        size={100}
      />
      {/* Multicolor rendering mode (pre-determined system colors) */}
      <SFSymbol
        name="phone.arrow.up.right"
        renderingMode="multicolor"
        size={100}
      />
    </View>
  );
}

<SFSymbol />

The SFSymbol component uses UIKit's UIImage view to render SF Symbols.

Props

name

The name of the symbol.

required: yes

type: SystemName

default: ""

color

The color of the symbol. This can be a single color or an array of colors depending on the rendering mode.

required: no

type: string or string[]

default: "#007AFFFF"

weight

The weight of the symbol.

required: no

type: "thin" | "ultraLight" | "light" | "regular" | "medium" | "semibold" | "bold" | "heavy" | "black"

default: "regular"

scale

The scale of the symbol.

required: no

type: "small" | "medium" | "large"

default: "small"

renderingMode

The rendering mode of the symbol.

required: no

type: "monochrome" | "hierarchical" | "palette" | "multicolor"

default: "monochrome"

size

The size of the symbol. This deifines the frame of the image view.

required: no

type: number

default: 42

variableValue

The variable value of the symbol.

required: no

type: number

default: 1.0

style

The style of the symbol.

required: no

type: StyleProp<ViewStyle>

default: undefined