ALOHA // NEXTUI
Text
Polymorphic text primitive with body, caption, label, and code variants styled for the ALOHA tropical light palette.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Text variant="caption" as="span">Crafted with care in Maui</Text>Variants
<Text variant="body">Body copy renders here.</Text>
<Text variant="caption" as="span">Crafted with care in Maui</Text>
<Text variant="label" as="span">Category</Text>
<Text variant="code" as="span">npm run dev</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 ALOHA // NEXT
Button
Tropical light-mode button with primary, secondary, and ghost variants in three sizes. Renders as a Next.js Link when an href is provided.
Badge
Tropical badge with coral, turquoise, yellow, green, and pink variants for category tags and labels.
Card
Tropical feature card with a colored icon element, category tag, title, and description. Supports coral, turquoise, yellow, green, and pink color variants.