Description:
Doodle Icons is a React icon library with 152 hand-drawn SVG icons and draw-on, boiling-line animation.
The package exposes typed React components, raw still and animated SVG files, and icon data for custom renderers.
Features
- 152 stroke-only icons on a 48×48 grid.
- Still SVG files and animated SVG files.
- Draw-on controls through
draw,drawDuration, anddrawDelay. - A page-wide boiling effect through one
BoilFilterinstance. - ESM, CommonJS, TypeScript declarations, and tree-shakable React components.
- Raw icon data through the
iconprop. ICONS,getIcon,ICON_NAMES,COLLECTIONS, andBOILexports for custom rendering and configuration.
How To Use It
Install the React package
npm i @oreo-design/doodle-iconsRender animated icons
draw animates the strokes on the first render. The animation replays when the component mounts again, so reserve it for icons that enter the screen once, such as a hero illustration or a newly revealed onboarding step.
import { BoilFilter, DoodleIcon } from "@oreo-design/doodle-icons";
export default function DoodleHeader() {
return (
<>
<BoilFilter id="boil" />
<div style={{ color: "rebeccapurple" }}>
<DoodleIcon name="heart" boilId="boil" size={32} />
<DoodleIcon name="star" boilId="boil" draw size={32} />
</div>
</>
);
}Set the boiling intensity
Use a second filter when one part of the interface needs a different motion level:
<BoilFilter id="boil" />
<BoilFilter id="boil-loud" amplitude={8} duration="0.3s" />
<DoodleIcon name="flame" boilId="boil-loud" />Use the icon color from CSS
The paths use currentColor. Apply a CSS color to a parent element or pass a style to the wrapper:
<span style={{ color: "rebeccapurple" }}>
<DoodleIcon name="bulb" boilId="boil" />
</span>Render SVG files directly
Use icons/ for still files and icons-animated/ for animated files. Copy the selected file into the asset path used by the application:
<img src="/icons-animated/heart.svg" width="48" height="48" alt="" />API reference
DoodleIcon
| Prop | Default | Purpose |
|---|---|---|
name | None | Selects an icon by name, such as heart. |
icon | None | Passes icon data directly. |
size | 24 | Sets both SVG dimensions in pixels. |
strokeWidth | 3.4 | Changes the stroke width. |
boilId | None | Points to a mounted BoilFilter. |
draw | false | Draws the strokes in sequence on first render. |
drawDuration | 0.32 | Sets the seconds used per stroke. |
drawDelay | 0 | Sets the delay before the first stroke. |
Supporting exports
| Export | Purpose |
|---|---|
DoodleStyles | Registers the draw keyframes on its own, with no BoilFilter. |
BOIL | Exposes the default boiling values for custom configuration. |
getIcon(name) | Returns the icon data for a custom renderer. |
ICONS, ICON_NAMES, COLLECTIONS | Provide icon data, names, and groupings for pickers and custom rendering. |
BoilFilter
| Prop | Default | Purpose |
|---|---|---|
id | doodle-boil | Identifier referenced by boilId. |
amplitude | 4 | Sets the ink displacement in viewBox units. |
duration | 0.86s | Sets the duration of one loop. |
frequency | 0.055 | Sets the noise grain. |
frames | 6 | Sets the number of hand-drawn animation steps. |