Style hooks
CSS classes
Components that render an HTML element accept aclassName prop to style the element with CSS classes.
switch.tsx
switch.tsx
Data attributes
Components provide data attributes designed for styling their states. For example, Switch can be styled using its[data-checked] and [data-unchecked] attributes, among others.
switch.css
CSS variables
Components expose CSS variables to aid in styling, often containing dynamic numeric values to be used in sizing or transform calculations. For example, Popover exposes CSS variables on itsPopup component like --available-height and --anchor-width.
popover.css
Style prop
Components that render an HTML element accept astyle prop to style the element with a CSS object.
switch.tsx
switch.tsx
Tailwind CSS
Apply Tailwind CSS classes to each part via theclassName prop.
menu.tsx
CSS Modules
Apply custom CSS classes to each part via theclassName prop. Then style those classes in a CSS Modules file.
menu.tsx
CSS-in-JS
Wrap each component part and apply styles, then assemble your styled components.menu.tsx