shadimage
slide-cn
componentheader-with-contentsource: ok · hit

Header with content

A layout with a header, and some content space

npx shadcn add "https://slide-cn.com/r/header-with-content.json"
free

Where it goes

navbar

Tags auto-generated by rules on 9/24/2026 — empty means no evidence, not lack of support.

Files1 · source cached 10/9/2026, 3:29:21 PM

components/ui/slide-cn/header-with-content.tsx
import { cn } from "@/lib/utils";

/**
 * HeaderWithContent
 *
 * A simple layout for a slide. Very lightly styled. Can be overwritten using the className prop
 *
 * Usage
 * ```tsx
 * <Deck>
 * 	<Slide background={<BackgroundComponent/>}>
 * 		<HeaderWithContent>
 * 			<HeaderWithContent.Header>
 * 				Welcome to slide-cn
 * 			</HeaderWithContent.Header>
 * 			<HeaderWithContent.Content>
 * 				Content of the slide
 * 			</HeaderWithContent.Content>
 * 		</HeaderWithContent>
 * 	</Slide>
 * </Deck>
 * ```
 */

export function HeaderWithContent({ children, className, ...props }: React.ComponentProps<"div">) {
	return (
		<div
			className={cn(
				"flex flex-col w-full h-full p-4 md:p-8 gap-4",
				className
			)}
			{...props}
		>
			{children}
		</div>
	)
}

HeaderWithContent.Header = function Header({ children, className, ...props }: React.ComponentProps<"h1">) {
	return (
		<h1
			className={cn(
				"font-bold text-foreground text-2xl md:text-4xl lg:text-6xl tracking-tight antialiased",
				className
			)}
			{...props}
		>
			{children}
		</h1>
	)
}

HeaderWithContent.Content = function Content({ children, className, ...props }: React.ComponentProps<"div">) {
	return (
		<div
			className={cn(
				"text-muted-foreground text-sm md:text-xl lg:text-2xl flex-1",
				className
			)}
			{...props}
		>
			{children}
		</div>
	)
}

More from slide-cn

Browse all components in this library →