BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/interlace-ui/button-variants

Button Variants

interlace-ui/button-variants
FreeComponent

The cva variant map that `button.tsx` imports — variant × size class strings and nothing else. Pure CVA: no React, no client APIs, so a server component can style a plain `<a>` with `buttonVariants({ variant, size })`.

Install it

npx shadcn@latest add https://ds.interlace.tools/r/button-variants.json

Source

registry/interlace-ui/button-variants.tsds.interlace.tools/r/button-variants.json · first 6 KB
1import { cva, type VariantProps } from 'class-variance-authority';
2
3// @interlace/button-variants v1.3.0 — Interlace design system.
4// Docs, props and live preview: https://ds.interlace.tools/c/button-variants
5// What changed since: https://ds.interlace.tools/c/button-variants#history
6// Generated banner — keep it, the upgrade diff reads this version.
7
8/**
9 * @interlace/ui — buttonVariants
10 *
11 * The cva variant map that `button.tsx` imports — variant × size class strings
12 * and nothing else. Pure CVA: no React, no client APIs, so a server component
13 * can style a plain `<a>` with `buttonVariants({ variant, size })`.
14 *
15 * This is not a component. It exports a function and a type, renders nothing,
16 * and has no props, no slots and no DOM — which is exactly why it is a
17 * separate module from the `'use client'` Button that consumes it.
18 *
19 * ## Anatomy
20 *
21 * buttonVariants({ variant, size })
22 * ├─ variant default | destructive | outline | secondary | ghost | link
23 * └─ size default | xs | sm | lg | icon | icon-xs | icon-sm | icon-lg
24 *
25 * Defaults are `variant: 'default'`, `size: 'default'`. `pagination.tsx` is
26 * the in-repo example of styling an element rather than nesting a Button: its
27 * `<a>` takes `buttonVariants({ variant, size })` directly. (It reaches the
28 * function through `button.js`, which re-exports it — that path is
29 * `'use client'`; import from this module to keep a server tree server-side.)
30 *
31 * ## Why half this file is comments
32 *
33 * Four of the six variants carry a long note recording a measured contrast
34 * failure and the rule it produced: a variant that declares its own foreground
35 * must paint an opaque surface in the same state, because a button is dropped
36 * onto surfaces the design system does not control. `outline` inheriting the
37 * page text into a `bg-primary` section measured 1.05:1; `link` with
38 * `text-primary` on the same section measured 1.00:1. `composite-contrast-lock`
39 * composites every variant over every brandable backdrop, so those notes are
40 * checkable rather than folklore.
41 *
42 * | Rule | Concept | Where in this file |
43 * | ---- | -------------------------------- | ----------------------------------------------------------- |
44 * | R8 | Enums, no booleans | `variant` and `size` are closed string enums |
45// … truncated

Facts

Registry
interlace-ui
Type
registry:ui
Access
Free
Files written
0
Licence
the repository states none
First indexed
2026-08-12
Last confirmed
today

Go to the source

ds.interlace.tools Raw registry item This item as JSON

More from interlace-ui

All 140 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
A11y Startera11y-starterinterlace-uiComponentsFreeno deps
Accordionaccordioninterlace-uiComponentsFreeno deps
Alertalertinterlace-uiComponentsFreeno deps
Alert Dialogalert-dialoginterlace-uiComponentsFreeno deps
Animated Gradient Textanimated-gradient-textinterlace-uiComponentsFreeno deps
Animated Grid Patternanimated-grid-patterninterlace-uiComponentsFreeno deps
Animated Listanimated-listinterlace-uiComponentsFreeno deps
Article Cardarticle-cardinterlace-uiComponentsFreeno deps
BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex

BlockDex

Built by

Kynth Studios

the studio behind StoreReady, ToolDrift and BreachProbe

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product.

BlockDex