NOIR // NEXTUI
Text
Polymorphic text primitive with body, caption, label, and code variants styled for the NOIR dark palette.
$
Or install the base component for free:
Live Preview
Open full demoUsage
TSX
<Text variant="caption" as="span">Last updated 2 hours ago</Text>Variants
<Text variant="body">Body copy renders here.</Text>
<Text variant="caption" as="span">Last updated 2 hours ago</Text>
<Text variant="label" as="span">Status</Text>
<Text variant="code" as="span">bearer_token_xyz</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 NOIR // NEXT
Button
Dark-mode button with primary, secondary, and ghost variants in three sizes. Renders as a Next.js Link when an href is provided.
Badge
Inline badge with violet, cyan, green, amber, and red variants for status labels and category tags in the NOIR dark palette.
Card
Composable dark card container with header, body, and footer sub-components in the NOIR aesthetic.