CRATE // NEXTUI
Text
Polymorphic text component with body, caption, label, and code variants. Archivo Black for display, DM Sans for body.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Text variant="body">Single-origin beans sourced from small farms.</Text>Variants
<Text variant="body">Single-origin beans sourced from small farms.</Text>
<Text variant="caption">Roasted within 24 hours</Text>
<Text variant="label">ORIGIN</Text>
<Text variant="code">const roast = await getRoastProfile()</Text>
Source
TSX
import { cn } from '@/lib/utils'
type Variant = 'body' | 'caption' | 'label' | 'code'
type As = 'p' | 'span' | 'div' | 'h2' | 'h3' | 'h4'
interface TextProps {
variant?: Variant
as?: As
className?: string
children: React.ReactNode
}
const variantClass: Record<Variant, string> = {
body: 'text-body',
caption: 'text-caption',
label: 'text-label',
code: 'text-code',
}
export function Text({
variant = 'body',
as: Tag = 'p',
className,
children,
}: TextProps): React.JSX.Element {
return (
<Tag className={cn(variantClass[variant], className)}>
{children}
</Tag>
)
}
Works withNext.js 15React 19Tailwind v4TypeScript 5
More from CRATE // NEXT
Button
Kraft-paper button with primary, secondary, ghost, and accent variants in three sizes. Archivo Black labels, warm cardboard palette. Renders as a Next.js Link when an href is provided.
Badge
Artisanal badge with accent, ink, kraft, stamp, and faded variants. Uppercase tracking on warm cardboard surfaces.
Card
Origin card with shipping label aesthetic, tape motif, dashed borders, and slight rotation transform. Displays weight, roast, origin, and date fields.