Heart icon

Added in v0.2.0

A free pencil-style heart icon, drawn by code from 1 bezier curve and 1 polyline. Use it as an SVG, a React component, or by name. MIT licensed.

heart

01Use it

Use heart

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 { Heart } from '@matita/icons/react';

<Heart size={24} />

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

JavaScript

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

toSvg(Heart, { 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-heart" data-sketch="" aria-hidden="true"><path d="M5.94 11.91C4.67 11.22 4.37 9.98 4.14 9.08C4.12 7.94 4.43 6.79 5.44 6.2C6.28 5.42 7 4.88 8.04 4.8C9.07 5.06 10.14 5.55 11.1 6.11C11.83 7.02 12.18 7.8 12.11 9.01C12.08 7.86 12.39 6.85 12.82 6.2C13.67 5.28 14.93 4.89 15.82 5.1C16.83 4.9 17.7 5.57 18.57 5.99C19.53 6.73 19.96 7.76 19.89 8.85C19.94 10.16 19.36 11.19 18.26 11.81" stroke-width="1.472"/><path d="M5.13 11.5Q8.91 15.18 12.14 19.35Q15.39 15.22 18.96 11.36" stroke-width="1.504"/></svg>

Pencil variant

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

<Heart size={32} pencil />

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

02How it's drawn

The recipe for heart

Heart is not stored as a drawing. It is a recipe of 1 bezier curve and 1 polyline 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
B 5.37 11.83 4.62 11.08 4.2 10.06 4.2 9 4.2 7.94 4.62 6.92 5.37 6.17 6.12 5.42 7.14 5 8.2 5 9.26 5 10.28 5.42 11.03 6.17 11.78 6.92 12.2 7.94 12.2 9 12.2 7.94 12.22 6.92 12.97 6.17 13.72 5.42 14.74 5 15.8 5 16.86 5 17.88 5.42 18.63 6.17 19.38 6.92 19.8 7.94 19.8 9 19.8 10.06 19.38 11.08 18.63 11.83;
P 5.4 11.8 12 19.5 18.6 11.8
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 heart. Seed 0 is the default.

wobble 0
wobble 0.25
wobble 0.5
wobble 0.75
wobble 1

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

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

True pixel sizes.

Ink
Pencil