Capítulo 6 de 43
Radix Primitives are fully unstyled — you're responsible for both functional and presentational styles, applied via the className prop each part accepts, with component state exposed through data-state/data-* attributes.
className pass-through: every part accepts className, forwarded directly to its DOM element — the only styling hook you need for plain CSS.data-state attribute: stateful parts expose their state (e.g. data-state="open" on an open Accordion Item) so CSS/CSS-in-JS can target state without JS.React.forwardRef and pass props through, same pattern as any custom React component wrapping a library component..AccordionItem {
border-bottom: 1px solid gainsboro;
}
.AccordionItem[data-state="open"] {
border-bottom-width: 2px;
}
data-state attribute, no JS state tracking needed.data-state (and other data-* attributes documented per-component) is the idiomatic way to style state transitions, works identically with plain CSS, CSS Modules, or CSS-in-JS.forwardRef component wrapping — no special Radix API needed.data-state for CSS keyframe animations tied to mount/unmount state.asChild is the mechanism for going beyond className when you need full control of the rendered element.