FEAST // NEXTUI
Text
Polymorphic text primitive with body, caption, label, and code variants styled for the FEAST dark culinary palette.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Text variant="caption" as="span">Serves 2, 90 min</Text>Variants
<Text variant="body">Body copy renders here.</Text>
<Text variant="caption" as="span">Serves 2, 90 min</Text>
<Text variant="label" as="span">Course</Text>
<Text variant="code" as="span">Table 14</Text>
Source
TSX
import { cn } from '@/lib/utils'
type TextVariant = 'body' | 'caption' | 'label' | 'code'
type TextAs = 'p' | 'span' | 'div'
interface TextProps {
variant?: TextVariant
as?: TextAs
className?: string
children: React.ReactNode
}
const VARIANT_CLASSES: Record<TextVariant, string> = {
body: 'feast-text-body',
caption: 'feast-text-caption',
label: 'feast-text-label',
code: 'feast-text-code',
}
export function Text({
variant = 'body',
as: As = 'p',
className,
children,
}: TextProps): React.JSX.Element {
return (
<As className={cn(VARIANT_CLASSES[variant], className)}>
{children}
</As>
)
}
Works withNext.js 15React 19Tailwind v4TypeScript 5
More from FEAST // NEXT
Button
Rich dark-mode button with gold-accented primary, secondary, and ghost variants in three sizes. Renders as a Next.js Link when an href is provided.
Badge
Gold-toned badge for category and status labels in the FEAST dark culinary palette.
Card
Composable dark card with header, body, and footer sub-components in the FEAST culinary aesthetic.