4.3.1 • Published 9 months ago
@marianmeres/icons-fns v4.3.1
@marianmeres/icons-fns
Icon svgs from various providers wrapped as functions (with props argument) returning the icon svg string. Each icon function lives in a separate file and is typed.
All credit (and copyright) belongs to these icon providers:
- Bootstrap icons
- Boxicons
- Bytesize icons
- Feather icons
- Font Awesome Icons (Free)
- Heroicons
- Phosphoricons
- Lucide icons
Thanks for the amazing work.
Install
npm i @marianmeres/icons-fnsUsage
Each icon function is prefixed with the vendor name (and icon type where applicable):
- Bootstrap:
iconBs - Boxicons:
iconBx - Bytesize:
iconBytesizeRegular,iconBytesizeSolid - Feather:
iconFeather - Font Awesome Icons (Free):
iconFaRegular,iconFaSolid - Heroicons:
iconHeroMini,iconHeroOutline,iconHeroSolid - Phosphoricons:
iconPhBold,iconPhDuotone,iconPhFill,iconPhLight,iconPhRegular,iconPhThin - Lucide:
iconLucide
Signature for all icon functions is:
iconPrefixIconName(props?: Partial<{
size: number;
class: string;
style: string;
// stroke-width is supported only for "Feather", "Bytesize" and "Lucide"
strokeWidth: number;
}>): string;so the actual usage example may look like:
import { iconHeroMiniAcademicCap } from '@marianmeres/icons-fns/heroicons/mini/iconHeroMiniAcademicCap.js';
const svg = iconHeroMiniAcademicCap({
class: 'inline-block',
size: 32,
style: 'color: blue;',
});
// svg now contains:
// <svg class='inline-block' width="32" height="32" style="color: blue;" ... >...</svg>All functions are typed, so your IDE should be able to typehint:
![]()
Related
4.3.1
9 months ago
4.3.0
10 months ago
3.1.1
2 years ago
4.0.4
2 years ago
4.1.0
1 year ago
4.0.1
2 years ago
4.0.0
2 years ago
4.0.3
2 years ago
4.2.0
1 year ago
4.0.2
2 years ago
3.1.0
2 years ago
3.0.0
2 years ago
2.3.0
2 years ago
2.2.0
2 years ago
2.5.0
2 years ago
2.4.0
2 years ago
2.7.0
2 years ago
2.6.0
2 years ago
2.1.0
2 years ago
2.0.2
3 years ago
2.0.1
3 years ago
1.1.1
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago