Looking things up
Order to try
- Editor types — if you are editing TypeScript in a typed project, hover or autocomplete on the component. Fastest and always matches the installed version.
- The bundled declarations —
node_modules/raft-ui/dist/index.d.mts. Authoritative for the version actually installed. - The token stylesheet —
node_modules/raft-ui/dist/foundation.cssfor colors, shadows, and the light and dark scopes;styles.cssfor Tailwind mappings. - The recipe source — only available when working inside the raft-ui monorepo, see below.
What ships in the package
The published package contains no src/. Do not look for .tsx files in a consumer's node_modules.
node_modules/raft-ui/
├── CHANGELOG.md
├── package.json
├── README.md
├── dist/
│ ├── index.d.mts every stable component, part, and prop type
│ ├── index.mjs stable runtime
│ ├── cn.d.mts the cn helper
│ ├── cn.mjs
│ ├── wip.d.mts unstable surface
│ ├── wip.mjs
│ ├── foundation.css native CSS token contract
│ ├── styles.css Tailwind mappings
│ └── fonts.css
└── skills/ bundled raft-ui agent skillsFinding a prop type
rg -n -A6 "^type ButtonProps =" node_modules/raft-ui/dist/index.d.mtsAdapt the pattern to how the declarations actually read. The last line of index.d.mts is one export { … } statement that lists the whole stable surface:
tail -n 1 node_modules/raft-ui/dist/index.d.mts | tr ',' '\n'If a name is absent from index.d.mts, treat it as unavailable on the stable surface. Check wip.d.mts only when the user explicitly asks to consider unstable APIs.
Finding a variant's allowed values
Variant unions come through VariantProps<typeof <recipe>>. Read the variant keys in the declared TVReturnType above the component props; the bundled declarations preserve those keys.
Do not infer a variant value from another component — the names are not consistent. See the intent table in feedback.md.
Finding a token
rg -o -- "--color-[a-z0-9-]+" node_modules/raft-ui/dist/styles.css | sort -uUse this before writing any color class. If a token is not in that list, it does not exist — see styling.md.
Inside the raft-ui monorepo
When packages/ui/src/ is present you are working on the library itself, not consuming it. There the tv() recipe is the source of truth:
packages/ui/src/components/<component>/<component>.recipe.ts (or <component>.tsx when there is no recipe file)Read the variants block for the exact option names and the compoundVariants block for behavior that depends on a combination of variants. The docs compositions under apps/doc/src/modules/<component>/compositions/ show canonical usage.
When the answer is not there
Say so and ask, or read the declarations again. Do not invent a prop name that "should" exist because another library has it. A guessed prop is silently dropped onto the DOM or ignored, and the bug surfaces much later as a styling problem.