Skip to content

Usage

Core options

ts
import { noteEighth } from "@prastavna/icons";

noteEighth({ size: 20 });
noteEighth({ width: 18, height: 28 });
noteEighth({ color: "#0f172a", strokeWidth: 1.5 });
noteEighth({ class: "icon icon-note", "aria-hidden": "true" });
noteEighth({ viewBox: "0 0 32 32", id: "note-eighth" });

DOM usage

ts
import { dynamicForte } from "@prastavna/icons";

const container = document.querySelector("#icon");

if (container) {
  container.innerHTML = dynamicForte({ size: 24, color: "currentColor" });
}

React wrapper

tsx
import { noteQuarter } from "@prastavna/icons";

export function QuarterNote() {
  return <span dangerouslySetInnerHTML={{ __html: noteQuarter({ size: 24 }) }} />;
}

Vue wrapper

vue
<script setup lang="ts">
import { clefTreble } from "@prastavna/icons";

const svg = clefTreble({ size: 24, color: "#7c3aed" });
</script>

<template>
  <span v-html="svg" />
</template>

Metadata

Each icon function also exposes metadata.

ts
import { restQuarter } from "@prastavna/icons";

restQuarter.iconName;
restQuarter.category;
restQuarter.variant;
restQuarter.viewBox;
restQuarter.svg;

Rendering behavior

  • Outline icons render with fill="none" and map color to stroke.
  • Filled icons render with stroke="none" and map color to fill.
  • size sets both width and height unless width or height override it.
  • Arbitrary SVG attributes pass through to the root <svg> element.

Categories

CategorySubpathIcons per variant
Notes@prastavna/icons/notes9
Rests@prastavna/icons/rests6
Clefs@prastavna/icons/clefs4
Accidentals@prastavna/icons/accidentals5
Time Signatures@prastavna/icons/time-signatures7
Dynamics@prastavna/icons/dynamics9
Articulations@prastavna/icons/articulations6
Ornaments@prastavna/icons/ornaments5
Repeats@prastavna/icons/repeats6
Barlines@prastavna/icons/barlines5
Beams@prastavna/icons/beams3
Ties@prastavna/icons/ties2
Slurs@prastavna/icons/slurs2
Pedals@prastavna/icons/pedals2
Bows@prastavna/icons/bows2
Misc@prastavna/icons/misc6

Released under the MIT License.