00Pencil-style icons for the web

Ruled by the grid.
Sketched by code.

380+ pencil-style icons as SVG and React components. Each one is a few simple shapes that code draws like a pencil would: lines overshoot their ends, boxes cross at the corners and circles overlap where the pen closes. The same name always draws the same way, everywhere.

npm i @matita/icons
  • 380+ glyphs
  • 24 grid
  • 1.6 stroke
  • currentColor
  • MIT
Fig. 01 · Specimenimage
  1. 1Boxes cross at the corners
  2. 2Circles overlap where the pen closes
  3. 3Strokes run past their ends

01Icons

The set

Click an icon for its code. Size, stroke and colour are yours to change. Every icon also has its own page. See what's new in 0.6.0.

24
1.6
Seed 0
100%
100%

383 icons

02Install

Install & use

One package, four ways in. Icons inherit currentColor and are decorative unless you give them a title.

npm i @matita/icons

React

Every icon is a component. SketchIcon takes a name and an optional seed; the provider sets defaults for a subtree.

import { ArrowRight, SketchIcon, SketchIconProvider } from '@matita/icons/react';

<ArrowRight size={20} color="#2748F5" />
<SketchIcon name="crosshair" pencil />
<SketchIconProvider size={24} strokeWidth={1.4}>…</SketchIconProvider>

JavaScript

No framework needed. Render to a string, or create a DOM element.

import { Ruler, toSvg, createElement } from '@matita/icons';

toSvg(Ruler, { size: 24 });              // SVG string
document.body.append(createElement(Ruler, { size: 24, pencil: true }));

CDN

Drop in placeholders and swap them in one call.

<i data-sketch-icon="ruler" data-size="24"></i>
<script src="https://cdn.jsdelivr.net/npm/@matita/icons/dist/umd/sketch-icons.min.js"></script>
<script>SketchIcons.replaceIcons({ icons: SketchIcons.icons });</script>

SVG files

Plain files for design tools, sprites and anything else.

@matita/icons/icons/<name>.svg     // ink
@matita/icons/pencil/<name>.svg    // pencil variant
@matita/icons/sprite.svg           // <symbol id="<name>">
@matita/icons/icons.json           // path data for every glyph
@matita/icons/pencil.css           // paper grain for the pencil variant (dial: --matita-grain, 0 to 1)
Props
PropTypeDefaultWhat it does
sizenumber | string16Width and height in px (or any CSS length).
colorstringcurrentColorStroke colour.
strokeWidthnumber1.6Stroke width on the 24 grid. Every stroke scales with it.
pencilbooleanfalsePencil variant: every stroke drawn as two or three loose pencil lines. Pair with pencil.css for the paper grain.
titlestringnoneAccessible label. Without it the icon is aria-hidden.
seednumber0SketchIcon only: a different drawing that always comes out the same for that seed.
wobblenumber1SketchIcon only: how much hand there is, from 0 (exact shapes: true lines, circles and corners) to 1 (the full drawing).

03How it's drawn

Drafted, then drawn

Each glyph is a few drafting primitives on a 24 grid. A seeded hand turns them into pencil strokes, so the wobble is designed, not random.

Primitives
CodePrimitiveArguments
LLinex1 y1 x2 y2
PPolylinex y x y …
ZClosed shapex y x y …
RRectanglex y w h
CCirclecx cy r
EEllipsecx cy rx ry
AArccx cy r a0 a1
QCurvex1 y1 cx cy x2 y2
ODotcx cy
A · Source
R 3.5 5 17 14;
C 9 10 1.6;
P 3.8 17 9.5 12.5 13 15.5 16 13 20.2 16.8
B · Plotted
C · Drawn

Same name, same seed, same drawing: in SVG, React and the browser, on every machine. Change the seed for another take.

seed 0
seed 1
seed 2
seed 3
seed 4

04Pencil variant

Ink, or graphite

Pass pencil and every stroke is drawn as two or three loose pencil lines, like a quick sketch. Import pencil.css once for the paper grain, and set --matita-grain from 0 (solid lines) to 1 (full grain) to dial it.

Fig. 02 · Ink
Fig. 03 · Pencil
import '@matita/icons/pencil.css';
import { Ruler } from '@matita/icons/react';

<Ruler size={32} pencil />

05Follow along

Watch it grow

New icons land in regular releases. See what just arrived, what is being built next, and how the pencil hand works.

06Used in

Where Matita shows up

Libraries and projects that ship Matita. Using it somewhere? Open an issue or write to hello@matita.dev and it can be listed here.

Fig. 04 · In sketchcn
The sketchcn docs page for Matita: a row of Matita icons, and sketchcn buttons, a date picker and a theme toggle that use them

sketchcn

A registry of hand-drawn React components in the shadcn style. Since 0.2.0 its Button, Checkbox, Dialog, Native Select, Sheet, Sidebar and Toast use Matita for their icons, and its docs have an icons page with install steps.