Particular.Tech
Layoutui

Page header

Page title, description, and actions.

Databases

Postgres branches that scale to zero and restore to any point in time.

Installation

npx shadcn@latest add @particular/page-header
npm dependencies
  • cn@^0.4.0

Source

ui/page-header.tsx
import * as React from "react"
import { cn } from "cn"

function PageHeader({ className, ...props }: React.ComponentProps<"header">) {
  return (
    <header
      data-slot="page-header"
      className={cn(
        "flex flex-col gap-4 border-b pb-6 sm:flex-row sm:items-end sm:justify-between",
        className
      )}
      {...props}
    />
  )
}

function PageHeaderContent({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div data-slot="page-header-content" className={cn("flex min-w-0 flex-col gap-1.5", className)} {...props} />
  )
}

function PageHeaderTitle({ className, ...props }: React.ComponentProps<"h1">) {
  return (
    <h1
      data-slot="page-header-title"
      className={cn("font-heading text-2xl font-semibold tracking-tight text-balance", className)}
      {...props}
    />
  )
}

function PageHeaderDescription({ className, ...props }: React.ComponentProps<"p">) {
  return (
    <p
      data-slot="page-header-description"
      className={cn("max-w-2xl text-sm text-pretty text-muted-foreground", className)}
      {...props}
    />
  )
}

function PageHeaderActions({ className, ...props }: React.ComponentProps<"div">) {
  return (
    <div data-slot="page-header-actions" className={cn("flex shrink-0 flex-wrap items-center gap-2", className)} {...props} />
  )
}

export { PageHeader, PageHeaderContent, PageHeaderTitle, PageHeaderDescription, PageHeaderActions }