HAIKU // NEXTUI

Button

Japanese-inspired light-mode button with primary, secondary, and ghost variants in three sizes. Renders as a Next.js Link when an href is provided.

$npx @voltenworks/shipui add button --theme haiku
Or install the base component for free:
Live Preview
Open full demo
voltenworks.com/shipui/haiku/demo/components#1-button
Usage
TSX
<Button variant="primary" size="md">Begin</Button>
Variants
<Button variant="primary">Begin</Button>
<Button variant="secondary">Explore</Button>
<Button variant="ghost">Return</Button>
<Button variant="primary" size="sm">Start</Button>
<Button variant="primary" size="lg">Begin your journey</Button>
Source
TSX
import Link from 'next/link'
import type { UrlObject } from 'url'
import { cn } from '@/lib/utils'

interface ButtonBaseProps {
  variant?:   'primary' | 'secondary' | 'ghost'
  size?:      'sm' | 'md' | 'lg'
  className?: string
  children:   React.ReactNode
}

type ButtonAsButton = ButtonBaseProps &
  Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, keyof ButtonBaseProps> & {
    href?: never
  }

type ButtonAsLink = ButtonBaseProps &
  Omit<React.ComponentPropsWithoutRef<typeof Link>, keyof ButtonBaseProps> & {
    href: string | UrlObject
  }

type ButtonProps = ButtonAsButton | ButtonAsLink

const SIZE_CLASSES: Record<NonNullable<ButtonBaseProps['size']>, string> = {
  sm: 'haiku-btn-sm',
  md: 'haiku-btn-md',
  lg: 'haiku-btn-lg',
}

const VARIANT_CLASSES: Record<NonNullable<ButtonBaseProps['variant']>, string> = {
  primary:   'haiku-btn-primary',
  secondary: 'haiku-btn-secondary',
  ghost:     'haiku-btn-ghost',
}

export function Button({
  children,
  variant   = 'primary',
  size      = 'md',
  className,
  ...props
}: ButtonProps): React.JSX.Element {
  const classes = cn('haiku-btn', SIZE_CLASSES[size], VARIANT_CLASSES[variant], className)

  if ('href' in props && props.href !== undefined) {
    const { href, ...linkProps } = props
    return (
      <Link href={href} className={classes} {...linkProps}>
        {children}
      </Link>
    )
  }

  const { type = 'button', ...buttonProps } = props as React.ButtonHTMLAttributes<HTMLButtonElement>
  return (
    <button type={type} className={classes} {...buttonProps}>
      {children}
    </button>
  )
}
Preview in theme demoGet full theme, $29
Works withNext.js 15React 19Tailwind v4TypeScript 5
More from HAIKU // NEXT
HAIKU // NEXTUI

Badge

Minimalist badge for tags and labels in the HAIKU Japanese-inspired light palette.

HAIKU // NEXTUI

Card

Composable light card with header, body, and footer sub-components in the HAIKU minimal Japanese aesthetic.

HAIKU // NEXTUI

Pullquote

Serene editorial blockquote with a ruled left accent, typographic quote marks, and an optional attribution citation.

HAIKU // NEXTUI

Seal

Circular hanko-style seal displaying a kanji character with an optional label. Available in red and neutral variants at configurable sizes.

HAIKU // NEXTUI

Text

Polymorphic text primitive with body, caption, label, and code variants styled for the HAIKU minimal Japanese light palette.