Repository navigation
Adding a Component
Hamroqulovv edited this page Oct 8, 2026
·
2 revisions
Framebits is curated: the core team adds components through pull requests. There is no uploading, marketplace, or moderation queue.
pnpm new-component <slug> --category=<category> [--title="..."] [--description="..."] [--type=component|lib|hook]| Argument | Rules |
|---|---|
<slug> |
kebab-case, 2–64 chars, unique across components, libs, and hooks. |
--category |
Required for components: text-animations, backgrounds, cursors, buttons, scroll, 3d, layout, utilities. |
--type |
component (default) | lib | hook. |
--title / --description
|
Title up to 120 chars; description 10–200 chars (replace the placeholder). |
This creates <slug>.tsx, demo.tsx, and meta.json (status: "draft",
today's date) from an SSR-safe, reduced-motion-aware template — and refuses
to overwrite an existing folder.
Source rules:
-
SSR-safe — no
window/documentat module scope or during render. -
Reduced motion — honor it (
useReducedMotionfrommotion/react,prefers-reduced-motionmedia, or CSS equivalent). -
Allowlisted deps only —
motion,framer-motion,gsap,three,ogl,clsx,tailwind-merge,class-variance-authority,lucide-react(+ React peer deps). Anything else fails the build. -
Clean imports — registry siblings only via
@/lib/*,@/hooks/*,@/components/ui/*; no relative escapes; every external import declared.
pnpm preview:install # once per machine (Playwright Chromium)
pnpm generate:previews # renders demos → commit hash-keyed WebP in registry/previews/
pnpm build:registry --write-lock # new slugs start at 1.0.0; changes bump patch
pnpm build:registry --check # CI gate: validates everything, writes nothing- Scaffold came from
pnpm new-component; description/tags finalized - Preview WebP committed;
--checkpasses -
pnpm lint,pnpm typecheck,pnpm testgreen - A reviewer has read the full source of every new/changed file (the security scan is a mistake-guard, not a boundary)
After merge, deploys publish it and npx @framebits/cli add <slug> just works.
Never delete a component — set
status: "deprecated". Never editregistry/components/**by hand outside this flow.
Full guide: CONTRIBUTING.md in the repo.
The normative spec lives in the repo:
docs/MASTER_PROMPT.md. If this wiki contradicts the repo, the repo wins — please open an issue.