@hackclub/icons
v0.2.1
Published
Hack Club’s iconset, a superset of spectrum-icons
Readme
@hackclub/icons 
Hack Club’s icons are a partial set of Supercons' incredible collection. Designed for use with our Design System.
Usage
With React
npm i @hackclub/iconsimport React from 'react'
import Icon from '@hackclub/icons'
export default () => (
<div style={{ color: 'cyan' }}>
<Icon glyph="clubs" size={128} />
<Icon glyph="bank-circle" size={64} />
<Icon glyph="leaders" size={32} />
</div>
)With the API
https://icons.hackclub.com/api/icons/:color/:glyph
:glyph- A glyph from icons.hackclub.com.:color- Any valid HTML color or Hack Club Theme color prefixed withhackclub-. Replace#with0xwhen using a hexadecimal color.
All responses are SVGs with the MIME type image/svg+xml. You can optionally include the .svg file extension.
Examples:
<img src="https://icons.hackclub.com/api/icons/red/clubs">
<img src="https://icons.hackclub.com/api/icons/hackclub-green/battery-bolt">
<img src="https://icons.hackclub.com/api/icons/0xc78ad4/sam.svg">In Figma
Copy and paste the Hack Club Icon component from the Figma file: figma.com/file/u8evOObGA4HCzUKlrVra1q/Hack-Club-Icon-Component
Choose the icon you'd like by modifying the Glyph.
Development Setup
- Clone & enter the repo.
$ git clone https://github.com/hackclub/icons.git
$ cd icons- Install dependencies.
$ bun install- Build library.
bun run prepare- Run docs locally.
bun run devUpdating icon sets
We split icons into two files:
src/standardGlyphs.tsx: upstream Supericons/Supercons glyphs.src/hackclubGlyphs.tsx: Hack Club-specific glyphs not in upstream.
To pull new upstream icons, update src/standardGlyphs.tsx and then run:
bun run prepareBackward-compatibility aliases are handled in src/index.tsx so existing glyph names continue to resolve.
Adding an icon
If you’d like to add an icon, the Figma file is Hack Club Icons. Try to design the icon only out of components of other icons, to keep consistency high, with those small square canvas sizes. When you’re done, clone your new icon, flatten all the layers into one shape for the simplest/smallest code/rendering, then export as an SVG with no background. Open the file, copy the <path>, then in the Icon source file, add a new one (alphabetically), using a wrapping <g> if you have several <path>s. Make sure to remove the fill attribute from all paths, & ensure you’re formatting props correctly as JSX (replacing hyphens with camelCase).
After publishing, remember to update the package dependency on the docs site so it’s showing the latest iconset.
