{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-header-02",
  "description": "A short dashboard header with a title, a date range menu and an export button.",
  "registryDependencies": [
    "https://www.dashboardblocks.com/r/radix/dashboard-header.json",
    "https://www.dashboardblocks.com/r/radix/format.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/dashboard-header/dashboard-header-02.tsx",
      "content": "'use client'\n\nimport {\n  type DateRangePreset,\n  DateRangePicker,\n  ExportMenu,\n  getDateRange,\n} from '@/registry/components/dashboardblocks/dashboard-header'\nimport { formatDateRange } from '@/registry/lib/dashboardblocks/format'\nimport { useState } from 'react'\n\ninterface DashboardHeader2Props {\n  defaultPreset?: DateRangePreset\n  onExport?: (format: string) => void\n  title: string\n  /** The last day of every date range preset. */\n  today: Date\n}\n\nconst exampleProps: DashboardHeader2Props = {\n  defaultPreset: '7d',\n  title: 'Revenue',\n  today: new Date(Date.UTC(2026, 8, 25)),\n}\n\nconst DashboardHeader2 = (props: DashboardHeader2Props) => {\n  const { defaultPreset = '7d', onExport = () => {}, title, today } = props\n  const [preset, setPreset] = useState<DateRangePreset>(defaultPreset)\n\n  return (\n    <header className='@container flex flex-col gap-1'>\n      <div className='flex items-start justify-between gap-3'>\n        <div className='flex min-w-0 flex-wrap items-baseline gap-x-2'>\n          <h2 className='text-2xl font-semibold tracking-tight'>{title}</h2>\n          <DateRangePicker\n            className='text-muted-foreground hover:text-foreground text-2xl font-light tracking-tight underline-offset-[6px] [&_svg]:size-5'\n            onValueChange={setPreset}\n            today={today}\n            value={preset}\n            variant='inline'\n          />\n        </div>\n        <ExportMenu onExport={onExport} />\n      </div>\n      <p aria-live='polite' className='text-muted-foreground text-sm tabular-nums'>\n        {formatDateRange(getDateRange(preset, today))}\n      </p>\n    </header>\n  )\n}\n\nexport {\n  DashboardHeader2,\n  exampleProps as dashboardHeader2ExampleProps,\n  type DashboardHeader2Props,\n}\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/dashboard-header/dashboard-header-02.tsx"
    }
  ],
  "meta": {
    "shows": "A short dashboard header with a title, a date range menu and an export button.",
    "size": "full",
    "usedWith": [
      "stat-group-01",
      "chart-panel-01"
    ],
    "component": "DashboardHeader2",
    "props": "{ defaultPreset?: \"24h\" | \"today\" | \"7d\" | \"30d\" | \"90d\"; onExport?: (format: string) => void; title: string; today: Date }"
  },
  "type": "registry:component"
}
