Template for building a Platform Blocks extension — an npm package of React Native components that build on @platform-blocks/ui (its theming, dark mode, and component APIs) and work everywhere Platform Blocks does: iOS, Android, and web.
The template ships a complete development environment: a sample Marquee component, an Expo example app that hot-reloads the package source on every platform, Jest, ESLint, TypeScript, a react-native-builder-bob build, CI, and one-command npm releases.
- Click Use this template on GitHub, then clone your new repository.
- Replace every occurrence of
platform-blocks-extension-templatewith your package name, and updaterepository,description, andkeywordsinpackage/package.json. - Install and run:
npm install
npm run example # start the Expo example app (i / a / w for iOS / Android / web)The example app imports the package from the package/ workspace, so edits to package/src/ hot-reload live.
| Path | What it is |
|---|---|
package/ |
The extension — this is what gets published to npm |
package/src/components/<Name>/ |
One component per directory: source, types.ts, __tests__/, plus meta/component.md and demos/ in the same convention the core library uses for its docs |
example/ |
Expo app for developing and demoing the extension on every platform |
| Script | What it does |
|---|---|
npm run example |
Start the example app |
npm test |
Run the package's Jest suite |
npm run lint |
Lint the package source |
npm run typecheck |
Type-check the package |
npm run build |
Build ESM + CJS + type declarations into package/lib/ |
npm run release:patch / :minor / :major |
Version-bump and publish to npm (npm login first) |
npm run lint && npm run typecheck && npm test && npm run buildCI runs the same checks on every push and weekly against the newest in-range @platform-blocks/ui.
Publish your extension to npm (any name works — platform-blocks-* makes it easy to find), then open a pull request on platform-blocks/platform-blocks adding it to the extensions registry with a one-line description. Accepted extensions are listed on platform-blocks.com.
MIT