EMBER // NEXTUI
Text
Polymorphic text primitive with body, caption, label, and code variants. Renders as p, span, or div via the `as` prop.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Text variant="label" as="span">Category</Text>Variants
<Text variant="body">Body copy renders here.</Text>
<Text variant="caption" as="span">Updated 3 days ago</Text>
<Text variant="label" as="span">Category</Text>
<Text variant="code" as="span">npm run build</Text>
Source
TSX
import type * as React from 'react'
import { cn } from '@/lib/utils'
type TextVariant = 'body' | 'caption' | 'label' | 'code'
type TextAs = 'p' | 'span' | 'div'
interface TextProps {
children: React.ReactNode
variant?: TextVariant
as?: TextAs
className?: string
}
const variantClass: Record<TextVariant, string> = {
body: 'emb-text-body',
caption: 'emb-text-caption',
label: 'emb-text-label',
code: 'emb-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 EMBER // NEXT
Button
Warm-toned button with primary, secondary, and ghost variants in three sizes. Renders as a Next.js Link when an href is provided.
Badge
Ember-styled badge with five color variants: orange, amber, green, red, and muted. Suited for category labels, status tags, and inline highlights.
Card
Composable card with Card, CardHeader, CardBody, and CardFooter sub-components. Uses `emb-ui-card` CSS classes for the Ember warm palette.