Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marcbouchenoire/symbolist

πŸ”£ A collection of every symbol from SF Symbols.
https://github.com/marcbouchenoire/symbolist

font icons san-francisco symbols

Last synced: 3 months ago
JSON representation

πŸ”£ A collection of every symbol from SF Symbols.

Awesome Lists containing this project

README

        

# Symbolist

πŸ”£ A collection of every symbol from SF Symbols.

[![build](https://img.shields.io/github/actions/workflow/status/marcbouchenoire/symbolist/.github/workflows/ci.yml?color=%23e27)](https://github.com/marcbouchenoire/symbolist/actions/workflows/ci.yml)
[![npm](https://img.shields.io/npm/v/symbolist?color=%23e27)](https://www.npmjs.com/package/symbolist)
[![size](https://img.shields.io/bundlephobia/minzip/symbolist?label=size&color=%23e27)](https://bundlephobia.com/package/symbolist)
[![coverage](https://img.shields.io/codecov/c/github/marcbouchenoire/symbolist?color=%23e27)](https://codecov.io/gh/marcbouchenoire/symbolist)
[![license](https://img.shields.io/github/license/marcbouchenoire/symbolist?color=%23e27)](https://github.com/marcbouchenoire/symbolist/blob/main/LICENSE)

- πŸ€– [**Automated**](#automation): Authored and updated automatically
- πŸ§ͺ **Reliable**: Fully tested with [100% code coverage](https://codecov.io/gh/marcbouchenoire/symbolist)
- πŸ“¦ **Typed**: Written in [TypeScript](https://www.typescriptlang.org/) and includes definitions out-of-the-box
- πŸ’¨ **Zero dependencies**

## Introduction

[SF Symbols](https://developer.apple.com/sf-symbols/) is a library of iconography from Apple, integrated into the San Francisco system fonts.

## Installation

```bash
npm install symbolist
```

## Usage

#### `symbols`

Import `symbols`.

```typescript
import { symbols } from "symbolist"

// symbols: {"0.circle": "τ€€Έ", "0.circle.fill": "τ€€Ή", ...}
```

#### `getSymbol`

Import `getSymbol`.

```typescript
import { getSymbol } from "symbolist"
```

Given a symbol name, `getSymbol` will return its symbol (or `undefined` for unknown symbols).

```typescript
const symbol = getSymbol("scribble.variable")

// symbol: "􀀑"
```

#### `getSymbolName`

Import `getSymbolName`.

```typescript
import { getSymbolName } from "symbolist"
```

Given a symbol, `getSymbolName` will return its name (or `undefined` for unknown symbols).

```typescript
const name = getSymbolName("τ€£³")

// name: "lasso.and.sparkles"
```

## Automation

Symbols are extracted with the `generate` commandβ€”using the [SF Symbols](https://developer.apple.com/sf-symbols/) app.

#### Types

`generate` prepares types along its symbols which means `getSymbol` and `getSymbolName` will validate symbol names when using TypeScript.

## Versioning

This package follows SF Symbols' versioning for major and minor versions.