Function
SectionHeader
({
label,
title,
description,
className,
align,
as = 'h2',
variant = 'default',
}: {
label?: string;
title: string | React.ReactNode;
description?: string | React.ReactNode;
className?: string;
align?: 'center' | 'left';
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
variant?: keyof typeof variants;
})
Source from the content-addressed store, hash-verified
| 23 | }; |
| 24 | |
| 25 | export function SectionHeader({ |
| 26 | label, |
| 27 | title, |
| 28 | description, |
| 29 | className, |
| 30 | align, |
| 31 | as = 'h2', |
| 32 | variant = 'default', |
| 33 | }: { |
| 34 | label?: string; |
| 35 | title: string | React.ReactNode; |
| 36 | description?: string | React.ReactNode; |
| 37 | className?: string; |
| 38 | align?: 'center' | 'left'; |
| 39 | as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'; |
| 40 | variant?: keyof typeof variants; |
| 41 | }) { |
| 42 | const Heading = as; |
| 43 | return ( |
| 44 | <div |
| 45 | className={cn( |
| 46 | 'col gap-4', |
| 47 | align === 'center' |
| 48 | ? 'center-center text-center' |
| 49 | : 'items-start text-left', |
| 50 | className, |
| 51 | )} |
| 52 | > |
| 53 | {label && <SectionLabel>{label}</SectionLabel>} |
| 54 | <Heading className={cn(variants[variant], 'max-w-3xl leading-tight')}> |
| 55 | {title} |
| 56 | </Heading> |
| 57 | {description && ( |
| 58 | <p className={cn('text-muted-foreground max-w-3xl')}>{description}</p> |
| 59 | )} |
| 60 | </div> |
| 61 | ); |
| 62 | } |
| 63 | |
| 64 | export function SectionLabel({ |
| 65 | children, |
Callers
nothing calls this directly
Tested by
no test coverage detected