Components · v0.1 · Stable
Button
Nova's most-used control. Polymorphic, accessible, and tuned for physical feedback — a soft downward compress on press and a diagonal sheen on hover.
Example
The primary call to action. Filled variants carry the signature gloss.
Installation
Install via the Nova CLI, or copy the component into your project.
CLI
npx @novix-ui/cli add buttonImport
import { Button } from "@novix-ui/react";Playground
Change any prop. The preview updates instantly.
Playground
Variants
Seven variants cover the intent spectrum. Reserve accent for a single hero action per view.
Sizes
Loading and icons
As child
Set asChild to render the button styles onto a child element — commonly a router link. All button props, states, and events flow through.
import { Link } from "@tanstack/react-router";import { Button } from "@novix-ui/react"; <Button asChild> <Link to="/pricing">See pricing</Link></Button>API
variant"primary" | "accent" | "secondary" | "outline" | "ghost" | "destructive" | "link""primary"Visual intent. Filled variants ship with the Nova gloss sheen.size"sm" | "md" | "lg" | "icon""md"Height and horizontal padding. Use size='icon' for square icon-only buttons.asChildbooleanfalseMerge props onto the child element instead of rendering a <button>. Use with <Link>, <a>, etc.loadingbooleanfalseReplaces the leading icon with a spinner and marks the button aria-busy.leadingIconReactNode—Icon rendered before the label. Automatically sized to match the text.trailingIconReactNode—Icon rendered after the label. Ideal for arrows, external-link glyphs.
Keyboard
| Key | Action |
|---|---|
| Tab | Move focus to the button. |
| Enter / Space | Activate the button. |
| Shift + Tab | Move focus to the previous focusable element. |
Accessibility
- Rendered as a native
<button>unlessasChildis set. - Icon-only buttons must receive
aria-label. PreferIconButtonwhich enforces it at the type level. - Loading state applies
aria-busyand blocks pointer events without collapsing size. - Focus ring uses two layers so it stays visible on any background.
Design guidelines
One hero per view
Reserve the accent variant for the primary action of a screen. Multiple accents cancel each other out.
Label with a verb
"Save changes" beats "OK". Buttons commit to an outcome — say what happens next.
Size matches surface
sm for dense toolbars, md for forms, lg for landing heroes. Don't mix in the same row.
Destructive gets confirmation
Pair destructive with a dialog or undo. Never a single-click delete.
Common mistakes
- Wrapping a
Linkin a Button instead of usingasChild— produces invalid nested interactives. - Using
size="icon"without anaria-label. Screen readers will announce "button" with no name. - Disabling a button during async work instead of using
loading. Disabled buttons drop out of the tab order and hide progress.