Create a component
Write the component once. If it only reads tokens, it already works in Raw, Silk and Volume.
- Structure in TSX, material in CSS. Layout, semantic colors and geometry tokens (
rounded-(--du-radius-control),h-(--du-h-md)) go in className. Borders, shadows, type, transforms and keyframes go in the material layer. - Put
data-slotafter the props spread. Triggers withasChildpass their own slot down; the component must keep its own or it loses its material. - Never branch on style. If a style needs a different geometry, add a token and give every style a value.
- No
outline-noneon focusable parts. Focus rings come from the base layer and each style tunes them.
Add an example file in src/examples (default export), then an entry in src/docs/components.ts. The page, preview, compare mode, search entry and registry item are generated from that entry. Optional: a props playground in src/docs/playgrounds.tsx.