Patterns
Page hero (premium header)
For a screen's front door: crumbs, identity, facts, actions, headline numbers and tabs in one framed block.
Facility · GCP
Gulshan Car Park
OpenMulti-storey car park on Gulshan Avenue. Gate mode runs on two lanes; monthly parkers use the left lane.
- Gulshan 1, Dhaka
- 24/7
- 6 staff on shift
- Occupancy
- 82%
- ↑ 6% vs last week
- Revenue today
- ৳48,250
- 312 sessions
- Avg stay
- 2h 14m
- last 7 days
- Open incidents
- 2
- 1 gate offline
page-hero.tsx
"use client";
import { Button, PageHero } from "@waveinno/ui";
import { Building2, Clock, Download, MapPin, Pencil, Users } from "lucide-react";
import * as React from "react";
export default function HeroDemo() {
const [tab, setTab] = React.useState("overview");
return (
<PageHero
crumbs={[{ label: "Facilities", href: "#" }, { label: "Dhaka", href: "#" }, { label: "Gulshan Car Park" }]}
icon={<Building2 />}
eyebrow="Facility · GCP"
title="Gulshan Car Park"
badge={{ label: "Open", tone: "success" }}
description="Multi-storey car park on Gulshan Avenue. Gate mode runs on two lanes; monthly parkers use the left lane."
meta={[
{ icon: MapPin, label: "Gulshan 1, Dhaka" },
{ icon: Clock, label: "24/7" },
{ icon: Users, label: "6 staff on shift" },
]}
actions={
<>
<Button>
<Download /> Export
</Button>
<Button variant="primary">
<Pencil /> Edit facility
</Button>
</>
}
stats={[
{ label: "Occupancy", value: "82%", hint: "↑ 6% vs last week", tone: "success" },
{ label: "Revenue today", value: "৳48,250", hint: "312 sessions" },
{ label: "Avg stay", value: "2h 14m", hint: "last 7 days" },
{ label: "Open incidents", value: "2", hint: "1 gate offline", tone: "danger" },
]}
tabs={[
{ id: "overview", label: "Overview" },
{ id: "sessions", label: "Sessions", count: 312 },
{ id: "rates", label: "Rates" },
{ id: "monthly", label: "Monthly parkers", count: 48 },
{ id: "staff", label: "Staff", count: 6 },
]}
activeTab={tab}
onTabChange={setTab}
/>
);
}Import#
Everything comes from the package root. The example above uses:
your-component.tsx
import { Button, PageHero } from "@waveinno/ui";Props#
Read from the source of this version, so they match the code exactly.
<PageHero>
src/components/patterns/page-hero.tsx| Prop | Type | Default | Description |
|---|---|---|---|
crumbs | Crumb[] | — | |
icon | React.ReactNode | — | A lucide icon element, an avatar or an image, shown in a 56px tile. |
eyebrow | React.ReactNode | — | |
badge | { label: string; tone?: Tone } | — | |
titlerequired | React.ReactNode | — | |
description | React.ReactNode | — | |
meta | HeroMeta[] | — | |
actions | React.ReactNode | — | Buttons, right-aligned on desktop and below the title on phones. |
stats | HeroStat[] | — | |
tabs | HeroTab[] | — | |
activeTab | string | — | |
onTabChange | (id: string) => void | — | |
className | string | — |
<Button>
src/components/ui/button.tsx| Prop | Type | Default | Description |
|---|---|---|---|
asChild | boolean | false | |
loading | boolean | — |
Also takes ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants>.
Install#
If the project does not have the package yet, add it, then follow the setup for Next.js or Vite once.
$ npm install @waveinno/ui