Button
A native button with Zenos variants, sizing, icons, and loading feedback.
A native button with Zenos variants, sizing, icons, and loading feedback.
import { Button } from "@zentara-co/zenos-ui";With icons
Section titled “With icons”Use startIcon and endIcon to place a decorative icon on either side of the label.
Left or right: a UX rule
Section titled “Left or right: a UX rule”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.
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.
Variants
Section titled “Variants”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.
Custom styling
Section titled “Custom styling”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.
States
Section titled “States”Disabled and loading buttons cannot be activated. Loading buttons expose aria-busy to assistive technology.
Motion
Section titled “Motion”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
| Prop | Type | Default | Description |
|---|---|---|---|
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.