Dashboard Template
interlace-ui/dashboard-templateFreeBlock
Application dashboard surface. Topbar at top, persistent left sidebar (nav links), main content area (children). The standard "logged-in app" layout: every SaaS dashboard reaches for this shape.
Install it
npx shadcn@latest add https://ds.interlace.tools/r/dashboard-template.jsonSource
1import * as React from 'react';23// @interlace/dashboard-template v1.1.0 — Interlace design system.4// Docs, props and live preview: https://ds.interlace.tools/c/dashboard-template5// What changed since: https://ds.interlace.tools/c/dashboard-template#history6// Generated banner — keep it, the upgrade diff reads this version.78/**9 * @interlace/ui — DashboardTemplate10 *11 * Application dashboard surface. Topbar at top, persistent left sidebar12 * (nav links), main content area (children). The standard13 * "logged-in app" layout: every SaaS dashboard reaches for this shape.14 *15 * ## MIN_VIEWPORT — 48016 *17 * Below 480, the sidebar collapses (consumer wires a Sheet+Drawer for18 * the hamburger menu). Above 480 it stays persistent.19 */2021import { cn } from '@/lib/utils';22import { SectionBoundary } from '@/components/ui/section-boundary';23import { Topbar } from '@/components/ui/patterns/topbar';24import { Skeleton } from '@/components/ui/skeleton';25import { Stack } from '@/components/ui/stack';2627export const MIN_VIEWPORT = 480 as const;2829interface DashboardTemplateProps extends React.ComponentProps<'div'> {30 topbar: React.ComponentProps<typeof Topbar>;31 /** Sidebar nav (typically a list of links). */32 sidebar: React.ReactNode;33 /** Page heading row (above the main content). */34 header?: React.ReactNode;35 /** Main content area. */36 children: React.ReactNode;37}3839function DashboardTemplate({40 topbar,41 sidebar,42 header,43 children,44 className,45 ...props46}: DashboardTemplateProps) {47 return (48 <div49 data-slot="dashboard-template"50 data-min-viewport={String(MIN_VIEWPORT)}51 className={cn(52 'bg-background text-foreground flex min-h-screen flex-col',53 className,54 )}55 {...props}56 >57 <Topbar {...topbar} />5859 <div className="flex flex-1">60 <aside61 className="border-border bg-card hidden w-60 shrink-0 border-r md:block"62 aria-label="Primary navigation"63 >64 <SectionBoundary name="dashboard-sidebar" skeletonVariant="card">65 {sidebar}66 </SectionBoundary>67 </aside>6869 <main className="flex-1 px-lg py-lg">70 {header ? (71 <SectionBoundary72 name="dashboard-header"73 skeletonVariant="page-header"74 className="mb-lg"75 >76 {header}77 </SectionBoundary>78 ) : null}79 <SectionBoundary name="dashboard-body" skeletonVariant="card">80// … truncated
More from interlace-ui
All 140 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Article Templatearticle-template | interlace-ui | Blocks | Free | no deps | |
| Auth Templateauth-template | interlace-ui | Blocks | Free | no deps | |
| Author Templateauthor-template | interlace-ui | Blocks | Free | no deps | |
| Blog Home Templateblog-home-template | interlace-ui | Blocks | Free | no deps | |
| Docs Page Templatedocs-page-template | interlace-ui | Blocks | Free | no deps | |
| Error Templateerror-template | interlace-ui | Blocks | Free | no deps | |
| Landing Templatelanding-template | interlace-ui | Blocks | Free | no deps | |
| Registry Item Templateregistry-item-template | interlace-ui | Blocks | Free | no deps |
