Block
Page Title Bar
88px header: avatar or ringed icon, title + description, search/notification utilities and actions.
react-aria-componentslucide-react
Preview
Jordan Blake
Welcome back to Vantu 👋
Team
Manage and collaborate with your sales team.
"use client";
import { CalendarDays, Plus, Users } from "lucide-react";
import { PageTitleBar } from "@/components/blocks/page-title-bar";
import { Avatar } from "@/components/ui/avatar";
import { Button } from "@/components/ui/button";
export default function Example() {
return (
<div className="w-full divide-y divide-line bg-surface">
<PageTitleBar
bareLeading
leading={<Avatar name="Jordan Blake" size="xl" status="online" />}
title="Jordan Blake"
description="Welcome back to Vantu 👋"
actions={
<>
<Button leadingIcon={<CalendarDays />}>Schedule</Button>
<Button variant="primary" leadingIcon={<Plus />}>New deal</Button>
</>
}
/>
<PageTitleBar leading={<Users />} title="Team" description="Manage and collaborate with your sales team." />
</div>
);
}Installation
Components are copied into your project — no runtime package.
Install the following dependencies:
terminalnpm install react-aria-components lucide-reactCreate a
page-title-bar.tsxfile and paste the following code into it.src/components/blocks/page-title-bar.tsx"use client"; import { Bell, Search } from "lucide-react"; import type { ReactNode } from "react"; import { IconButton } from "@/components/ui/icon-button"; import { cx } from "@/utils/cx"; export interface PageTitleBarProps { title: ReactNode; description?: ReactNode; /** A 40px leading visual: an icon (rendered in a ringed circle) or an <Avatar size="lg">. */ leading?: ReactNode; /** Render `leading` as-is instead of inside the ring. */ bareLeading?: boolean; actions?: ReactNode; /** Show search and notification icon buttons. */ utilities?: boolean; className?: string; } /** 88px page header: leading mark, title + description, utilities and actions. */ export function PageTitleBar({ title, description, leading, bareLeading, actions, utilities = true, className }: PageTitleBarProps) { return ( <header className={cx("flex min-h-[88px] shrink-0 flex-wrap items-center gap-4 border-b border-line px-4 py-4 sm:px-8", className)}> {leading && (bareLeading ? ( leading ) : ( <span className="flex size-12 shrink-0 items-center justify-center rounded-full bg-surface text-fg-secondary shadow-[0_0_0_1px_var(--color-line),0_0_0_5px_var(--color-subtle)] [&_svg]:size-5"> {leading} </span> ))} <div className="min-w-0 flex-1"> <h1 className="truncate text-lg font-medium text-fg">{title}</h1> {description && <p className="mt-0.5 truncate text-base text-fg-secondary">{description}</p>} </div> <div className="flex flex-wrap items-center gap-2"> {utilities && ( <> <IconButton variant="ghost" aria-label="Search"> <Search /> </IconButton> <IconButton variant="ghost" aria-label="Notifications" className="relative"> <Bell /> <span className="absolute right-2.5 top-2 size-1.5 rounded-full bg-error ring-2 ring-surface" /> </IconButton> </> )} {actions} </div> </header> ); }Add the theme tokens and the
cxhelper from Installation if you haven’t yet, then update the import paths to match your project setup.