Skip to content
Playground

Button

A native button with Zenos variants, sizing, icons, and loading feedback.

A native button with Zenos variants, sizing, icons, and loading feedback.

TSX
import { Button } from "@zentara-co/zenos-ui";

Use startIcon and endIcon to place a decorative icon on either side of the label.

Placement is not decorative. In a left-to-right interface, the eye enters at the start of the button and exits at the end. A leading icon identifies the action; a trailing icon signals direction, disclosure, or what comes next.

Leading — identifies the action
Read before the label, a leading icon names the action and creates a scannable anchor. Use it for actions such as add, download, delete, and search.
Trailing — signals what comes next
A trailing icon points onward. Reserve it for forward navigation, disclosure, and links that leave the current context.
Don't — place an icon on both sides
Two icons split the focal point and make one button read as competing ideas. Pick the single side that best matches the intent.

Directional meaning overrides the default. A back arrow belongs at the inline start because it points where the action travels. In right-to-left interfaces, think in start and end rather than fixed left and right positions; Zenos handles the visual order through startIcon and endIcon.

Buttons use the shared Zenos sm, md, and lg control scale.

Choose a variant that reflects the action’s visual priority and meaning. Neutral, semantic, and accent variants use deeper surfaces in dark mode instead of inheriting the palette’s pastel emphasis colors.

Use the usual className prop for your own appearance. You do not need to supply variant or variantClassName. Your classes apply last and override conflicting built-in styles while preserving sizing, focus, disabled, loading, icon, and native button behavior.

Define the surface, border, foreground, and any hover or active treatments you want to replace. Prefer semantic tokens for theme-aware colors. A layout-only class such as w-full keeps the default appearance; className does not implicitly remove styles you have not overridden.

Disabled and loading buttons cannot be activated. Loading buttons expose aria-busy to assistive technology.

Buttons use a short scale transition while pressed to reinforce activation. The transition is removed automatically when the user prefers reduced motion.

Set disableMotion when a button sits inside another animated control, when a surrounding interaction already supplies feedback, or when the button must respond without movement. Hover, pressed colors, focus visibility, and activation behavior remain unchanged.

Press and hold

Color feedback only

PropTypeDefaultDescription
variant ButtonVariant | custom string default Visual intent.
className string — Custom styling and instance overrides. No variant prop is required.
variantClassName string — Optional classes for existing named-variant integrations. Use className for custom styling.
size 'sm' | 'md' | 'lg' md Control height and padding.
isLoading boolean false Shows progress and disables activation.
disableMotion boolean false Disables the pressed-state scale and transition for this button.
startIcon / endIcon ReactNode — Icons around the label.
type ButtonHTMLAttributes.type button Native button type.

Button forwards native button props and its ref. Loading state sets aria-busy; supply a clear loadingLabel when there is no visible label.