DINK // NEXTUI
Text
Typography utility with heading, body, caption, and code variants. Fredoka display font for headings, DM Sans for body text.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Text variant="heading">Build playful products</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 DINK // NEXT
Button
Retro-toy button with bold 3px borders and flat offset shadows. Solid, outline, and ghost variants in a playful cream and cobalt palette.
Badge
Pill badge with bold borders and color variants. Yellow, cobalt, coral, and green options for retro-toy labeling.
Card
Feature card with icon, badge, title, and description. Bold borders and flat offset shadow on a cream background.