More

Contributing

Thank you for helping improve StateGlyph. This guide covers everything from local setup to submitting your first pull request.

Contribution workflow

01

Set up the repository

You need Node.js 22.19 or newer and npm 10.9 or newer. Clone the repo and install dependencies.

Terminal
git clone https://github.com/kamalhara/StateGlyph.gitcd StateGlyphnpm installnpm run dev
02

Make your change

Keep each pull request focused on one improvement. Use existing Lucide icons when adding or changing an icon state. Include accessible labels and respect reduced-motion preferences.

03

Verify your work

Run the full verification suite before submitting. All checks must pass.

Terminal
npm run lintnpm run typechecknpm testnpm run build
04

Create a changeset

If your change affects a published package, create a changeset. Choose the affected package and explain the user-visible change. Do not edit package versions manually.

Terminal
npm run changeset

Adding a new icon

An icon needs changes across several packages. Follow this checklist:

01

Add an icon specification and Lucide glyph mappings in tooling/generate-icon-library.mjs

02

Run npm run generate to create definitions, React components, exports, and website entries

03

For a new category, update core types, CLI labels, and the generator's category descriptions

04

Update count expectations and add tests for the new states

05

Run npm run format and the required verification commands

06

Add a changeset describing the user-visible addition

Guidelines

01

One PR per improvement

Keep pull requests focused. Don't bundle unrelated changes together.

02

Use existing Lucide icons

StateGlyph builds on the Lucide icon set. Use existing Lucide glyphs when adding states.

03

Include accessible labels

Every state must have a human-readable label. These are used for ARIA attributes.

04

Respect reduced motion

Mark continuous states appropriately. The shared renderer observes prefers-reduced-motion and cancels active animations.

05

Search before opening issues

Check existing issues and PRs before opening a duplicate.

Project structure

StateGlyph is an npm workspace monorepo using TypeScript, Next.js, Tailwind CSS, tsup, and Vitest.

StateGlyph/
├── apps/
│   └── docs/          # Next.js documentation site
├── packages/
│   ├── core/          # Icon definitions & types
│   ├── react/         # React components
│   ├── cli/           # Copy-and-own CLI
│   └── transitions/   # Animation utilities
├── tests/             # Shared test utilities
└── tooling/           # Build tooling

License

By contributing, you agree that your contribution is licensed under the MIT License used by this repository. The underlying Lucide icons are available under the ISC License.