p44
v0.7.1
Published
Svelte package exposing SVG icons crafted using P45.
Downloads
30
Readme
P44
Svelte package exposing SVG icons crafted using P45.
Icons will be added, removed, and modified before the first version so keep that in mind. Apply custom styles via CSS selectors.
Requires Svelte version 4.
Usage
<script>
import { Diamond, Star } from 'p44'
</script>
// Accepts <svg> HTML element attributes.
<Diamond width="100" height="100" class="classy" />
// Some icons accept optional props to refine their shape.
<Star leg="6" indent="0.5" class="classy2" />
<style>
:global(.classy) {
overflow: hidden;
border: 1px solid goldenrod;
}
:global(.classy2) {
overflow: hidden;
border: 1px solid goldenrod;
width: 100px;
height: 100px;
}
</style>
Keywords
A separate file containing icon component names mapped to their keywords is available:
import docs from 'p44/docs'
// To get icon component names.
console.log(Object.keys(docs))
/*
[
"BrokenTriangle"
"Chopsticks",
"Circle",
"Clock",
...
]
*/
// All metadata.
console.log(docs)
/*
{
"BrokenTriangle": {
"name": "Broken Triangle",
"alt": "A simple triangle broken at the top.",
"keywords": [
"broken",
"triangle",
"musical instrument"
]
},
"Chopsticks": {
"name": "Chopsticks",
"alt": "Two lines crossing to form an image of chopsticks.",
"keywords": [
"chopsticks",
"crossing lines"
]
},
...
}
*/
Components
+++(Do not remove: component docs are inserted here!!)+++