nalarx-ui
Components

Button

Five sizes, eight variants, tones and a selected state, with press feedback and an instant tooltip.

bunx shadcn@latest add @nalarx/button

Usage

import { Button } from "@/components/ui/nx/Button";

<Button variant="accent">Save</Button>
<Button variant="ghost" icon aria-label="Close" tip="Close"><Icon name="x" size={14} /></Button>
<Button render={<a href="/agents" />} nativeButton={false}>Open agents</Button>

Variants

One accent per screen at most: it is the screen's main action. primary is ink, for a strong action that is not the brand call to action.

Sizes

SizeHeightUse
xs24Dense row actions
sm28Toolbars, filters, actions inside a card
md32Default
lg40Modal footer primary, form submit, empty-state call to action
xl48Landing or onboarding hero, at most one per page

A pair of actions (Cancel and Save) shares one size. On phones, xs to md grow to a 36px touch target.

States

Icons

icon makes a square button; give it aria-label. handoff nudges a trailing arrow on hover for actions that take the user elsewhere.

Tones

Text colour by meaning, for the unfilled variants.

Tooltip and full width

tip shows at once on hover and keyboard focus (CSS only, no portal). Inside a container that clips, use Tooltip.

Props

Every Base UI Button prop (render, focusableWhenDisabled, nativeButton…), plus:

PropTypeDefault
variant"default" | "primary" | "accent" | "outline" | "soft" | "ghost" | "destructive" | "success""default"
size"xs" | "sm" | "md" | "lg" | "xl""md"
iconbooleanfalse
blockbooleanfalse
tone"secondary" | "muted" | "faint" | "danger" | "success"
selectedbooleanfalse
tip, tipAlignstring, "end"
handoff, tapTargetbooleanfalse

buttonVariants() returns the classes, for a link styled as a button.

Accessibility

A native <button type="button">; pass type="submit" in forms. The focus ring is a 2px ink outline. Disabled buttons drop to 40% opacity and keep a not-allowed cursor; never disable the main action without saying why next to it.

Replaces

NxBtn in both apps' components/ui/index.tsx and the Platform's base/Button.tsx. See the changelog for the mapping (destructive-ghost, glyph, form submit).

On this page