Battery icon

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

battery

01Use it

Use battery

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

<Battery size={24} />

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

JavaScript

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

toSvg(Battery, { 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-battery" data-sketch="" aria-hidden="true"><path d="M1.75 7.13Q10.82 6.68 19.89 7.07M18.82 5.58Q18.73 11.91 19.13 18.24M20.2 17.12Q11.13 16.76 2.06 16.96M2.49 18.02Q2.25 12.27 2.42 6.53" stroke-width="1.52"/><path d="M20.91 9.57Q20.8 12.11 21.02 14.66" stroke-width="1.744"/><path d="M6.15 9.83Q6.06 11.84 6.12 13.85" stroke-width="1.696"/><path d="M9.48 10.38Q9.47 12.14 9.68 13.91" stroke-width="1.488"/></svg>

Pencil variant

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

<Battery size={32} pencil />

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

02How it's drawn

The recipe for battery

Battery is not stored as a drawing. It is a recipe of 1 rectangle 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
R 2.5 7 16.5 10;
L 21 10 21 14;
L 6 10.5 6 13.5;
L 9.5 10.5 9.5 13.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 battery. Seed 0 is the default.

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

True pixel sizes.

Ink
Pencil