css_class prop for Tailwind styling and an id prop for targeting with custom CSS selectors.
Component IDs
Theid prop sets the HTML id attribute on a component’s outermost element. This is useful when you need to target a specific component with custom CSS or anchor links:
id is always applied to the outermost wrapper.
Tailwind Classes
A plaincss_class string works fine until you start mixing hover states, focus rings, and breakpoints — then the prefixes pile up:
prefab_ui.css module provides helpers that eliminate the repetition.
Composing with Lists
css_class accepts a list of strings, joined with spaces at build time. This lets you group related concerns and mix in helpers without worrying about spacing:
FocusVisible("border-b border-border") produces "focus-visible:border-b focus-visible:border-border". The list stitches everything together.
Variant Helpers
Each helper takes a string of space-separated classes and prefixes every one with its variant:Breakpoint Helpers
Same pattern, for responsive breakpoints:
These match Tailwind’s default breakpoints — each applies from that width and up.
Putting It Together
Variants and breakpoints compose freely. Here’s a card that adjusts padding at breakpoints, lifts on hover, and shows a focus ring for keyboard navigation:Responsive Layout Props
Layout props likecolumns and gap accept a separate Responsive helper that translates values into the right Tailwind classes — see Responsive Columns for an example.