A ready-to-use starting point for public React component and hook libraries (React 18 and 19). It comes with community files, issue and pull request templates, automated dependency updates, security checks, testing, and publishing to npm already in place.
- One or more npm packages in a single repository, each built and tested on its own
- An example React package (component, hook, styles, tests) and a small demo app to copy from
- Checks that React is never bundled, plus bundle-size limits
- Automatic checks on every pull request across Node 22, 24 and 26
- Publishing to npm when you create a GitHub release, with no stored tokens
- Contribution, conduct, support and security-reporting guidelines
- Issue forms and a pull request template
- Automated dependency updates, dependency review and weekly vulnerability checks
- Secret scanning before every commit
- Click Use this template on GitHub and create your new repository.
- Run the Init workflow from the Actions tab and merge the pull request it opens. This fills in your owner and repository name. Then delete
.github/workflows/init.yml. - Rename
packages/example-react-package, set your npm scope (replace@scope) and fill in the details in itspackage.json. Replace the example component, and update.size-limit.jsonand the demo imports. - Add your contact details in
CODE_OF_CONDUCT.mdand replace this description with your own. - Apply the repository protections and set up npm publishing by following the setup guide.
- Install the checks that run on each commit:
npm ci && pip install pre-commit && pre-commit install --hook-type pre-commit --hook-type post-commit.
import { ExampleComponent } from '@scope/example-react-package';
import '@scope/example-react-package/style.css';
<ExampleComponent name="World" />;React and react-dom 18 or 19 must be installed in your app.
See CONTRIBUTING.md. Please report security issues privately as described in SECURITY.md.
Released under the MIT License.