Styling architecture
Every component ships in two styles: Coloxo CSS Modules, or flat Tailwind TSX.
Two styles, one component API
A component is published twice: once as css-modules source, once as Tailwind source. The props, behaviour, and accessibility contract are identical, so moving between styles never changes the code that calls a component.
The registry stores them under styles.tailwind and styles["coloxo-css"]. The CLI resolves the list at install time and writes that style's files to their declared targets.
97 components ship in Coloxo CSS, 61 in Tailwind, and 61 ship in both. The tables below are generated from the registry, so they match what the installer will actually do.
Choosing a style
Pass --style to init or add. init saves the choice to coloxo.json as style; every later add reads it from there. Passing --style to a single add overrides it for that run only.
When you skip --style, the CLI decides from your project. No tailwindcss dependency means Coloxo CSS, with no prompt at all. If Tailwind is present, init asks once and defaults the answer to Tailwind.
In non-interactive --yes runs it takes the detected default instead of asking. An unknown --style value fails immediately rather than mid-install.
npx coloxo init --style tailwindnpx coloxo add button# or override for a single addnpx coloxo add card --style coloxo-cssColoxo CSS
Components import a co-located .module.css file. Class names are hashed, and every value reads a --cx-* custom property.
This is the original distribution and the default for projects without Tailwind. It has no styling peer beyond the token sheet you import once.
/* your app imports the token sheet once */@import "@coloxo/ui/styles.css";/* then override any semantic token on a host element */.brand-scope { --cx-color-bg-brand-solid: #2348ff;}Tailwind
The Tailwind style is flat, self-contained TSX: the classes are written into the file, so there is no CSS module to import and nothing to add to your Tailwind config.
Because the class strings live in the component, you can edit them directly after copying the source. That is the same copy-source ownership model the CSS Modules style gives you.
Tailwind never becomes a dependency of the library itself. Only installs that choose this style expect Tailwind in the host project.
// installed at components/ui/button.tsximport { cx } from "@/lib/utils";const CX: Record<string, string> = { base: "inline-flex items-center justify-center rounded-lg font-medium", "size-md": "h-10 px-4 text-sm",};export function Button({ size = "md", className, ...props }) { return <button className={cx(CX.base, CX[`size-${size}`], className)} {...props} />;}Style coverage
Coverage grows as components are ported. A component that offers only one style rejects the other with an explicit error instead of installing the wrong shape.
Visuals are the exception. They ship only as Coloxo CSS, and coloxo add still installs them in a Tailwind project. The command also adds @coloxo/ui to package.json so the stylesheet is in node_modules. Init does not install any visual; each slug is optional.
This table is generated from registry.json, so it reflects what `coloxo add` will accept today.
Style availability — 97 Coloxo CSS, 61 Tailwind, 61 dual-styled
| Component | Coloxo CSS (CSS Modules) | Tailwind CSS |
|---|---|---|
| accordion | Yes | Yes |
| alert | Yes | Yes |
| aurora-mesh-gradient | Yes | — |
| avatar | Yes | Yes |
| avatar-group | Yes | Yes |
| avatar-label-group | Yes | Yes |
| avatar-profile-photo | Yes | Yes |
| badge | Yes | Yes |
| bar-chart | Yes | Yes |
| bioluminescent-particles | Yes | — |
| breadcrumb | Yes | Yes |
| button | Yes | Yes |
| button-group | Yes | Yes |
| button-variants | Yes | Yes |
| card | Yes | Yes |
| chart-tooltip | Yes | Yes |
| checkbox | Yes | Yes |
| chromatic-aberration-text | Yes | — |
| code-block | Yes | Yes |
| color-picker | Yes | Yes |
| combobox | Yes | Yes |
| data-table | Yes | Yes |
| date-picker | Yes | Yes |
| dimensional-portal | Yes | — |
| dimensional-rift-scanner | Yes | — |
| divider | Yes | Yes |
| docs-header | Yes | Yes |
| drawer | Yes | Yes |
| dropdown | Yes | Yes |
| empty-state | Yes | Yes |
| energy-vortex | Yes | — |
| featured-icon | Yes | Yes |
| file-upload | Yes | Yes |
| fluid-background | Yes | — |
| force-field-membrane | Yes | — |
| form-control | Yes | Yes |
| form-field | Yes | Yes |
| generative-ribbon-field | Yes | — |
| gravitational-lens | Yes | — |
| gyroscopic-core | Yes | — |
| heading | Yes | Yes |
| holographic-liquid-orb | Yes | — |
| icon | Yes | Yes |
| icon-button | Yes | Yes |
| icons | Yes | Yes |
| input | Yes | Yes |
| input-group | Yes | Yes |
| input-otp | Yes | Yes |
| interactive-field-distortion | Yes | — |
| interactive-ripple-field | Yes | — |
| kbd | Yes | Yes |
| kinetic-grid-warp | Yes | — |
| label | Yes | Yes |
| liquid-metal-morph | Yes | — |
| living-wireframe-terrain | Yes | — |
| magnetic-field-visualizer | Yes | — |
| modal | Yes | Yes |
| notification | Yes | Yes |
| orbiting-planets | Yes | — |
| pagination | Yes | Yes |
| parametric-sculpture | Yes | — |
| particle-disintegration | Yes | — |
| particle-shape-transition | Yes | — |
| particle-typography | Yes | — |
| picker-field | Yes | Yes |
| pie-chart | Yes | Yes |
| progress-bar | Yes | Yes |
| radio | Yes | Yes |
| refraction-lens | Yes | — |
| refractive-glass-cube | Yes | — |
| select | Yes | Yes |
| self-drawing-geometry | Yes | — |
| skeleton | Yes | Yes |
| slider | Yes | Yes |
| soft-body-physics | Yes | — |
| spatial-glass-layers | Yes | — |
| spatial-glitch-distortion | Yes | — |
| spatial-object-gallery | Yes | — |
| spring-motion-trails | Yes | — |
| statistic | Yes | Yes |
| styles | Yes | Yes |
| switch | Yes | Yes |
| table | Yes | Yes |
| tabs | Yes | Yes |
| tag | Yes | Yes |
| terminal | Yes | Yes |
| text | Yes | Yes |
| textarea | Yes | Yes |
| theme | Yes | Yes |
| toggle | Yes | Yes |
| tooltip | Yes | Yes |
| utils | Yes | Yes |
| visual-runtime | Yes | — |
| visual-shared | Yes | — |
| volumetric-light-tunnel | Yes | — |
| vortex | Yes | — |
| wave-background | Yes | — |
$ npx coloxo add alert --style tailwind"alert" is not available for style "tailwind". Available styles: coloxo-css.Switching styles
Styles are alternatives, not layers, and each style installs to its own target path. A Tailwind button lands at components/ui/button.tsx while the Coloxo CSS version lands at components/ui/button/button.tsx plus its module and barrel file.
That means adding the other style does not overwrite your existing files — you get a second copy. Pick one style per component and delete the copy you no longer want.
Changing style in coloxo.json affects later installs only; it does not rewrite anything already in your tree.
Host applications
A consumer using Tailwind, vanilla CSS, or another system can host either style without collisions on internals.
The Coloxo CSS style keeps your own Tailwind setup intact, and the Tailwind style does not require you to adopt our spacing or colour scales.