NOCTA UI

Button

A versatile button component with multiple variants, sizes and dark mode support

Installation

Install the Button component using the nocta-ui CLI:

npx nocta-ui add button

Then import the component:

import { Button } from '@/components/ui/button';

Examples

Primary Button

Secondary Button

Ghost Button

Icon Button

Sizes

Three size options are available: sm, md, and lg. The default size is md.

Api Reference

PropTypeDefaultDescription
childrenReact.ReactNodeButton content
variant'primary' | 'secondary' | 'ghost' | 'icon''primary'Button style variant
size'sm' | 'md' | 'lg''md'Button size
classNamestring''Additional CSS classes
disabledbooleanfalseDisable the button
type'button' | 'submit' | 'reset''button'Button type (defaults to button to avoid accidental form submit)
aria-labelstringAccessible name for icon-only buttons
onClick() => voidClick handler

The Button component also accepts all standard HTML button attributes. When disabled is set, the component also exposes aria-disabled for assistive technologies.