create-component
Skill363 starsChanged 7 months agoMITView on GitHub
Guide for creating a new UI component in @gridland/ui. Covers file structure, focus integration, keyboard handling, theme usage, JSDoc, export registration, and documentation.
12 other projects use a version of this.
Adopted by
Most recently taken up by
- agentconfig/agentconfig.orgtheir own version, first seen Nov 8, 2026
- buildpad-ai/skillstheir own version, first seen Oct 16, 2026
- MUZEEBURRAHAMAN/forgetheir own version, first seen Oct 15, 2026
- monegit/agent-skillstheir own version, first seen Oct 13, 2026
- Simone-Tarantino/godot-superpowerstheir own version, first seen Oct 11, 2026
- Endava/BEEQtheir own version, first seen Oct 8, 2026
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- gluestack/gluestack-ui★ 5.3ksame name
- DataDog/datadog-agent★ 3.8ksame name
- compose-miuix-ui/miuix★ 1.6ksame name
- Endava/BEEQ★ 162same name
- incluud/astro-agent-skills★ 10same name
- agentconfig/agentconfig.org★ 7same name
- viknesh20-20/claude-code-tool-kit★ 7same name
- Simone-Tarantino/godot-superpowers★ 2same name
- buildpad-ai/skills★ 1same name
- MUZEEBURRAHAMAN/forge★ 1same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- audit-renderSkill
- debug-layoutSkill
- production-readySkill
- release-checkSkill
- review-docsSkill
- review-fullSkill
- reviewSkill
- sync-contextSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 2 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
Use kebab-case for directory/file names
- Distinctive: line 16
Use PascalCase for component function and props interface
- Very specific: line 39
Import theme from "@/registry/gridland/lib/theme", use textStyle() for styling
- Very specific: line 40
Use the @/registry/gridland/{ui,lib,hooks}/* alias form for every intra-package import.
- Very specific: line 41
Never hardcode hex colors — use theme.* tokens or accept color prop
- Very specific: line 96
Create the core demo in packages/demo/demos/<component-name>.tsx — export a named app component (e.g., export function MyComponentApp())
- Very specific: line 98
Create a doc page at packages/docs/content/docs/components/<component-name>.mdx
- Very specific: line 99
If the MDX page needs multiple demo variants, create a thin wrapper at packages/docs/components/demos/<component-name>-demo.tsx that …
- Very specific: line 105
Run /review to validate focus coverage and export conventions
- Very specific: line 106
Run /sync-context to update packages/ui/CLAUDE.md with the new component
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Guide for creating a new UI component in @gridland/ui.
1. File structure
packages/ui/components/<component-name>/
<component-name>.tsx # Main component file- Use kebab-case for directory/file names
- Use PascalCase for component function and props interface
2. Component template
// @ts-nocheck — only if using OpenTUI intrinsic elements (<box>, <text>, <span>)
import type { ReactNode } from "react"
import { textStyle } from "@/registry/gridland/lib/text-style"
import { useTheme } from "@/registry/gridland/lib/theme"
export interface MyComponentProps {
/** JSDoc every prop — agents and docs generators read these. */
children: ReactNode
}
/** One-line description of what the component does. */
export function MyComponent({ children }: MyComponentProps) {
const theme = useTheme()
// ...
}// @ts-nocheckat top ONLY when using<box>,<text>,<span>- Import theme from
"@/registry/gridland/lib/theme", usetextStyle()for styling - Use the
@/registry/gridland/{ui,lib,hooks}/*alias form for every intra-package import; shadcn's CLI rewrites these to the user'scomponents.jsonaliases at install time - Never hardcode hex colors — use
theme.*tokens or accept color prop - JSDoc on props interface, every prop, and component function
3. Focus integration (interactive components only)
import { useInteractive, FocusScope } from "@gridland/utils"
const { isFocused, isSelected, focusId, focusRef, onKey } = useInteractive({
id,
disabled,
shortcuts: [{ key: "enter", label: "select" }],
})
// Attach focusRef to root element
<box ref={focusRef}>...</box>
// Wrap nested interactive content
<FocusScope trap selectable autoFocus>{children}</FocusScope>
// Handle keys while selected (fires only when isSelected)
onKey((e) => {
if (e.name === "return") submit()
})disabledalone excludes from navigation — do NOT also settabIndex: -1useInteractiveinsideFocusScopeauto-binds to that scope (passscopeId={null}for global scope)- Display-only wrappers that share a
focusIdwith an inner interactive child should calluseInteractive({ id })withoutshortcutsand withoutonKey— the internal dispatch is a no-op so the inner component's shortcuts survive
4. Keyboard handling
import { useKeyboardContext } from "../provider/provider"
export interface MyComponentProps {
useKeyboard?: (handler: (event: any) => void) => void
}
const useKeyboard = useKeyboardContext(useKeyboardProp)
useKeyboard?.((event) => { /* handle keys */ })5. Export registration
In packages/ui/components/index.ts:
export { MyComponent } from "./<component-name>/<component-name>"
export type { MyComponentProps } from "./<component-name>/<component-name>"Both runtime export AND type export required.
6. Documentation
- Create the core demo in
packages/demo/demos/<component-name>.tsx— export a named app component (e.g.,export function MyComponentApp()) - Register it in
packages/demo/demos/index.tsx(import, re-export, and add todemosarray) - Create a doc page at
packages/docs/content/docs/components/<component-name>.mdx - If the MDX page needs multiple demo variants, create a thin wrapper at
packages/docs/components/demos/<component-name>-demo.tsxthat imports from@demos/<component-name>
Interactive components need interactive demos with useState + useKeyboard.
7. After creation
- Run
/reviewto validate focus coverage and export conventions - Run
/sync-contextto updatepackages/ui/CLAUDE.mdwith the new component
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

