Star icon

A free pencil-style star icon, drawn by code from 1 closed shape. Use it as an SVG, a React component, or by name. MIT licensed.

star

01Use it

Use star

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

<Star size={24} />

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

JavaScript

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

toSvg(Star, { 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-star" data-sketch="" aria-hidden="true"><path d="M12.11 3.54Q13.14 6.62 14.33 9.65Q17.38 10.03 20.45 10.07Q18.16 12.11 15.77 14.03Q16.39 17 17.2 19.93Q14.61 18.45 12.19 16.69Q9.36 18.1 6.71 19.82Q7.53 16.76 8.41 13.71Q5.72 11.85 3.25 9.7Q6.55 9.38 9.86 9.56Q10.87 6.5 12.11 3.54Q12.45 4.28 12.67 5.07" stroke-width="1.824"/></svg>

Pencil variant

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

<Star size={32} pencil />

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

02How it's drawn

The recipe for star

Star is not stored as a drawing. It is a recipe of 1 closed shape 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
Z 12 3.7 14.3 9.5 20.6 9.9 15.7 13.9 17.3 20 12 16.6 6.7 20 8.3 13.9 3.4 9.9 9.7 9.5
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 star. Seed 0 is the default.

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

True pixel sizes.

Ink
Pencil