CONTOUR // NEXTUI
Text
Polymorphic text component with body, caption, label, and code variants. IBM Plex Mono for labels and code, Space Grotesk for body.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Text variant="body">Signal processing complete.</Text>Variants
<Text variant="body">Signal processing complete.</Text>
<Text variant="caption">Last updated 2 minutes ago</Text>
<Text variant="label">STATUS</Text>
<Text variant="code">const signal = await fetch(endpoint)</Text>
Source
TSX
import { cn } from '@/lib/utils'
type TextVariant = 'body' | 'caption' | 'label' | 'code'
type TextElement = 'p' | 'span' | 'div' | 'h2' | 'h3' | 'h4'
interface TextProps {
children: React.ReactNode
variant?: TextVariant
as?: TextElement
className?: string
}
const variantClass: Record<TextVariant, string> = {
body: 'text-body',
caption: 'text-caption',
label: 'text-label',
code: 'text-code',
}
export function Text({
children,
variant = 'body',
as: Tag = 'p',
className,
}: TextProps): React.JSX.Element {
return (
<Tag className={cn(variantClass[variant], className)}>
{children}
</Tag>
)
}
Works withNext.js 15React 19Tailwind v4TypeScript 5
More from CONTOUR // NEXT
Button
Dark topographic button with primary, secondary, and ghost variants in three sizes. Neon green accent on midnight navy. Renders as a Next.js Link when an href is provided.
Badge
Topographic badge with neon, cream, warning, error, and info variants. Monospace labels on dark surfaces.
Card
Data card with icon, tag badge, title, and description. Supports wide variant for featured layouts. Midnight navy surface with neon green accents.