IcoSea is a Icon utility tool to generate flexible icon in .ts
file from
.toml
file
- Deno Version ^2.0.0 (for generation. after generation you can use with any javascript tool)
- Toml support in browser (optional)
- core functionality. generation part
- component generation for library.
- Svelte
- react
- Vue
[options]
height = 20
width = 20
color = "currentColor"
func_name = "icoseaIcon"
name = "mat_icon"
output = "icons/icosea/index.ts"
global_className = "mat_icons"
[icons]
3g = """<svg width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M4.33998 6.32671H5.07665V1.84004H3.08998V2.57671H4.33998V6.32671ZM7.25665 6.32671H10.4933V5.59004H7.99331V4.40421H10.4933V1.84004H7.25665V2.57671H9.75665V3.76337H7.25665V6.32671ZM2.25665 12.16H2.99331V8.41004H4.33998V10.91H5.07665V8.41004H6.42331V12.16H7.15998V7.67337H2.25665V12.16ZM8.50665 12.16H9.24331V10.91H11.7433V7.67337H8.50665V12.16ZM9.24331 10.1734V8.41004H11.0066V10.1734H9.24331ZM0.333313 13.6667V0.333374H13.6666V13.6667H0.333313Z" fill="black"/>
</svg>
"""
as you see in options we are taking some configuration.
height
- the default height of all iconswidth
- the default width of all iconscolor
- the default color of all iconfunc_name
- callable function name which will return your svg string. like thisname
- A name that can be used as reference inside code generationoutput
- specify where you want to store the outputglobal_className
- a global className by which
- Install Icosea Globally
deno install -gf jsr:@bns/icosea -n icosea
2.run command using Deno
icosea -f=<your icon.toml file>
3.In javscript use your spcefied function name in icon.toml
in any.js
import {icoseaIcon} from "icons/icosea/index.ts"
iconEl.innerHTML = icoseaIcon("iconKeyNameAsToml", {h:/* height */: 20, w/* width */: "20px", c/* color */:"#fff", cls/* individual className */: "heckingName"})
``
if you don't specify height
width
,fill
, stroke
then icosea won't place
any value. icosea just make these property dynamic.