DINK // NEXTUI
Button
Retro-toy button with bold 3px borders and flat offset shadows. Solid, outline, and ghost variants in a playful cream and cobalt palette.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Button variant="primary" size="md">Get started</Button>Variants
<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="ghost">Ghost</Button>
Source
TSX
import Link from 'next/link'
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 & {
href: string
}
type ButtonProps = ButtonAsButton | ButtonAsLink
const SIZE_CLASSES: Record<NonNullable<ButtonBaseProps['size']>, string> = {
sm: 'btn-sm',
md: 'btn-md',
lg: 'btn-lg',
}
const VARIANT_CLASSES: Record<NonNullable<ButtonBaseProps['variant']>, string> = {
primary: 'btn-primary',
secondary: 'btn-secondary',
ghost: 'btn-ghost',
}
export function Button({
children,
variant = 'primary',
size = 'md',
className,
...props
}: ButtonProps): React.JSX.Element {
const classes = cn('btn-base', 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>
)
}
Works withNext.js 15React 19Tailwind v4TypeScript 5
More from DINK // NEXT
Badge
Pill badge with bold borders and color variants. Yellow, cobalt, coral, and green options for retro-toy labeling.
Text
Typography utility with heading, body, caption, and code variants. Fredoka display font for headings, DM Sans for body text.
Card
Feature card with icon, badge, title, and description. Bold borders and flat offset shadow on a cream background.