@raulmoracode/icons
v1.0.2
Published
Icon library for RaulMoraCode projects
Readme
@raulmoracode/icons
Icon library for RaulMoraCode projects.
Installation
npm install @raulmoracode/iconsUsage
import { Apple, Github } from "@raulmoracode/icons";
import { Linux, Windows } from "@raulmoracode/icons";
import { Chain, Copy, CopyCheck, Globe, Mail, Share, Star, Website, X } from "@raulmoracode/icons";
function App() {
return (
<div>
<Apple size={24} />
<Github size={24} />
<Linux size={24} />
<Windows size={24} />
<Chain size={24} />
<Copy size={24} />
<CopyCheck size={24} />
<Globe size={24} />
<Mail size={24} />
<Share size={24} />
<Star size={24} />
<Website size={24} />
<X size={24} />
</div>
);
}Each icon can also be imported individually to keep your bundle small:
import { Mail } from "@raulmoracode/icons/Mail";Available Icons
The icon lists and the usage example above are generated from src/icons by
pnpm run generate. Add the icon file and run the command, do not edit those blocks by hand.
Enterprise
Apple- Apple logoGithub- GitHub logo
SO
Linux- Linux logoWindows- Windows logo
Common
Chain- Chain linkCopyCopyCheck- Copy with checkGlobeMail- EnvelopeShare- Upload arrow with trayStarWebsite- Browser windowX- Cross
Props
All icons accept the following props:
interface IconProps {
size?: number | string;
color?: string;
className?: string;
style?: React.CSSProperties;
}Development
# Install dependencies
pnpm install
# Build
pnpm run build
# Check formatting
pnpm run check
# Format code
pnpm run format
# Run tests
pnpm test
# Regenerate the icon registry (src/index.ts, package.json exports, README)
pnpm run generate
# Verify the registry is up to date (runs on CI)
pnpm run generate:checkAdding a new icon
- Create
src/icons/<group>/<Name>.tsx, the component must be named exactly like the file. - Add
src/icons/<group>/<Name>.test.tsxnext to it, following an existing icon test. - Add a single line
/** Description */JSDoc if the name is not self explanatory, it feeds the icon list above. - Run
pnpm run generateand commit the regenerated files.
Never edit src/index.ts, the exports map in package.json or the generated README blocks by
hand, pnpm run generate:check runs on CI and fails when they are out of date. Keeping them
generated means an icon PR only adds Icon.tsx and Icon.test.tsx, so two icons can be added in
parallel without conflicting.
