Key icon

Added in v0.2.0

A free pencil-style key icon, drawn by code from 1 circle and 3 lines. Use it as an SVG, a React component, or by name. MIT licensed.

key

01Use it

Use key

One package, four ways in. The icon inherits currentColor and is decorative unless you give it a title. Install it with npm i @matita/icons.

React

import { Key } from '@matita/icons/react';

<Key size={24} />

// or by name
import { SketchIcon } from '@matita/icons/react';
<SketchIcon name="key" />

JavaScript

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

toSvg(Key, { size: 24 });   // SVG string

SVG

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" overflow="visible" class="sketch-icon sketch-icon-key" data-sketch="" aria-hidden="true"><path d="M10.95 14.9C10.96 15.15 11.1 15.91 11 16.38C10.9 16.86 10.65 17.36 10.35 17.75C10.04 18.14 9.62 18.5 9.17 18.74C8.73 18.98 8.18 19.16 7.67 19.18C7.17 19.2 6.63 19.04 6.15 18.86C5.67 18.67 5.18 18.42 4.79 18.08C4.41 17.73 4 17.28 3.83 16.79C3.65 16.31 3.66 15.72 3.72 15.19C3.77 14.67 3.89 14.12 4.13 13.66C4.38 13.2 4.77 12.77 5.19 12.44C5.61 12.11 6.13 11.79 6.65 11.66C7.17 11.54 7.78 11.59 8.32 11.68C8.87 11.78 9.48 11.93 9.93 12.24C10.38 12.55 10.72 13.07 11 13.56C11.28 14.04 11.51 14.59 11.59 15.15C11.67 15.7 11.66 16.35 11.48 16.88C11.3 17.42 10.68 18.1 10.52 18.35" stroke-width="1.408"/><path d="M10.08 12.71Q14.56 8.16 19.16 3.72" stroke-width="1.696"/><path d="M17.04 5.2Q18.53 6.46 20.02 7.71" stroke-width="1.552"/><path d="M15.27 7.43Q16.37 8.35 17.34 9.4" stroke-width="1.376"/></svg>

Pencil variant

import '@matita/icons/pencil.css';
import { Key } from '@matita/icons/react';

<Key size={32} pencil />

The file is icons/key.svg in the package (pencil/key.svg for the pencil variant). Matita 0.7.0.

02How it's drawn

The recipe for key

Key is not stored as a drawing. It is a recipe of 1 circle and 3 lines on a 24 by 24 grid, and a small program draws it like a pencil would. The wobble comes from the name, so it always comes out the same.

A · Recipe
C 7.5 15.5 3.5;
L 10.4 12.6 19 4;
L 17.5 5.5 19.5 7.5;
L 15.5 7.5 17 9
B · Plotted
C · Drawn
How it works

03Takes, sizes, pencil

Same icon, every way

Pass a seed for another take of the same recipe. The wobble is capped, so it still reads at 16 px.

seed 0
seed 1
seed 2
seed 3
seed 4

Five seeds of key. Seed 0 is the default.

wobble 0
wobble 0.25
wobble 0.5
wobble 0.75
wobble 1

key from exact shapes (wobble 0) to the full hand (wobble 1, the default). The exact version is also a ready-made file: exact/key.svg.

16 px
20 px
24 px
32 px
48 px
96 px

True pixel sizes.

Ink
Pencil