Contributing
How components, blocks and framework ports are structured in the repository, and the checklist for adding one.
This page is the working guide for changing the library. For reporting bugs and requesting components, see the
repository's CONTRIBUTING.md.
Layout
packages/manicat/
frameworks.json registry of formats (react, react-native, vue…)
registry.json the item list: names, files, dependencies
registry/
foundation.css design tokens
components/<id>/ one folder per component
blocks/<id>/ one folder per block
lib/ cn, motion tokens, rn-tokens
public/r/ built shadcn payloads (generated)
apps/docs/ this siteAdding a component
- Create
registry/components/<id>/<id>.tsxand a.module.cssnext to it. Style with the tokens only. - Add an entry to
registry.jsonwith the files, npm dependencies andregistryDependencies. - Give it a
classNamesprop for its named parts, documented in the props JSDoc. - Run
pnpm --filter manicat build:registry, thenpnpm check. - Add the item to the tables in
README.mdand runpnpm --filter @manicat/docs groups. - Add a demo and examples (below).
Demos and examples
A demo is the main preview. In apps/docs/site/demos/*.tsx, export <ItemName>Demo:
export function ButtonDemo() {
return <Button>Save changes</Button>;
}Examples are real scenarios, in apps/docs/site/examples/*.tsx, exported as <ItemName><Scenario>Example with
a JSDoc @title and a sentence of description. The page picks them up by name. Their code, with imports rewritten to
the install path, is what the Code tab shows, so write them as code someone would paste into an app.
/**
* @title Issue properties
* Compact pickers in a ticket header.
*/
export function MorphSelectIssueExample() {
/* … */
}Use real content (a billing screen, a ticket header), not Item 1, Item 2.
Adding a framework port
- Put the file next to the React source with the suffix from
frameworks.json:<id>.rn.tsx,<id>.vue. - Keep prop and part names identical to the React version. Use
styleson native,classNameson the web. - React Native: import tokens from
@/lib/rn-tokens. Vue: read the CSS variables, prefix classes withmc-. - Optionally add
apps/docs/content/usage/<id>.<framework>.txt, the snippet shown in the Usage section. - Run
pnpm --filter manicat build:registryandpnpm check. Typechecking covers.rn.tsxwith the realreact-nativetypes and.vuewithvue-tsc.
To support a whole new framework, add an entry to frameworks.json with its id, label, suffix and lang, and
a Shiki mapping in apps/docs/lib/highlight.ts if the extension is new.
Checks
pnpm check # typecheck + lint + registry
pnpm dev # docs on :3000Run them once at the end of a batch of edits. check:registry fails if a built payload is out of date, so rebuild the
registry after changing any source file.