Button
Dark docs-style button with primary, secondary, and ghost variants in three sizes. Renders as a Next.js Link for internal hrefs and a plain anchor for external links.
<Button variant="primary" size="md">Get started</Button><Button variant="primary">Get started</Button>
<Button variant="secondary">View source</Button>
<Button variant="ghost">Learn more</Button>
<Button variant="primary" size="sm">Install</Button>
<Button variant="primary" size="lg">Read the docs</Button>
import type * as React from 'react'
import Link from 'next/link'
import { cn } from '@/lib/utils'
type ButtonVariant = 'primary' | 'secondary' | 'ghost'
type ButtonSize = 'sm' | 'md' | 'lg'
interface ButtonProps {
variant?: ButtonVariant
size?: ButtonSize
href?: string
onClick?: () => void
type?: 'button' | 'submit' | 'reset'
disabled?: boolean
className?: string
children: React.ReactNode
external?: boolean
}
export function Button({
variant = 'primary',
size = 'md',
href,
onClick,
type = 'button',
disabled = false,
className,
children,
external = false,
}: ButtonProps): React.JSX.Element {
const cls = cn(
'vault-btn',
`vault-btn--${variant}`,
`vault-btn--${size}`,
className,
)
if (href) {
if (disabled) {
return (
<a
href={href}
className={cn(cls, 'opacity-50 cursor-not-allowed pointer-events-none')}
aria-disabled="true"
tabIndex={-1}
onClick={(e) => e.preventDefault()}
>
{children}
</a>
)
}
if (external) {
return (
<a href={href} className={cls} target="_blank" rel="noopener noreferrer">
{children}
</a>
)
}
return (
<Link href={href} className={cls}>
{children}
</Link>
)
}
return (
<button type={type} onClick={onClick} disabled={disabled} className={cls}>
{children}
</button>
)
}
Badge
Semantic status badge with six color variants: green, blue, yellow, red, purple, and muted. Suited for version tags, API status labels, and changelog markers.
Callout
Inline callout block with four semantic variants: info, warn, tip, and danger. Each renders a matching icon and left-accent color for inline documentation alerts.
Card
Feature card with icon, title, optional badge, and description. Accepts an accent prop for a highlighted border variant. Icon set: book, code, key, zap, layers, terminal, shield, cpu.
CodeBlock
Syntax-highlighted code block with a header showing the language or file title and a one-click copy button. Client component with clipboard feedback.