SolidJS
pulsoicon-solid — animated SolidJS icons with the same props as every PulsoIcon package.
Try every example live on the SolidJS demo page. Looking for the filled drawings? See Solid icons.
Installation
npm install pulsoicon-solid
SolidJS 1.8 or newer. Motion 12 or newer plays the icons and is installed with the package.
Quick start
import { Bell, Calendar, Trash2 } from "pulsoicon-solid";
export function Toolbar() {
return (
<>
<button><Bell size={20} /> Notifications</button>
<button><Calendar /> Schedule</button>
<button><Trash2 color="crimson" strokeWidth={1.5} /> Delete</button>
</>
);
}
Props
size (24), color (currentColor), strokeWidth (2), absoluteStrokeWidth (false), solid (false), animated (true), autoAnimated (true) and play, as in React. Any other attribute (class, style, aria-label) goes on the <svg>. Props are reactive: pass a signal’s value and the icon follows it.
Outline, solid and static
<Heart />
<Heart solid />
<Heart animated={false} />
<Heart solid animated={false} />
Play from code
ref gives startAnimation() and stopAnimation(); both return a promise that resolves when the motion has finished.
import { Check, type IconHandle } from "pulsoicon-solid";
export function SaveButton() {
let check: IconHandle | undefined;
return (
<button onClick={() => check?.startAnimation()}>
<Check ref={check} autoAnimated={false} /> Save
</button>
);
}
Driven by state
const [hasNewMessage, setHasNewMessage] = createSignal(false);
<Bell autoAnimated={false} play={hasNewMessage()} />
Loading icons on demand
pulsoicon-solid/all exports every icon by kebab-case name (all of them). pulsoicon-solid/names lists the names without loading any icon, and pulsoicon-solid/icons/<name> loads one:
import { ICON_NAMES, type IconName } from "pulsoicon-solid/names";
const load = (name: IconName) => import(`pulsoicon-solid/icons/${name}`);
Accessibility
Icons render with aria-hidden="true"; label the button or link they sit in. Nothing moves when the system asks for reduced motion.