Docs Page Template
interlace-ui/docs-page-templateFreeBlock
Documentation page surface. Topbar at top, optional sidebar nav on the left (md+), main content in the centre with a `<Prose>` wrapper, and an optional TOC rail on the right (xl+).
Install it
npx shadcn@latest add https://ds.interlace.tools/r/docs-page-template.jsonSource
1import * as React from 'react';23// @interlace/docs-page-template v1.1.0 — Interlace design system.4// Docs, props and live preview: https://ds.interlace.tools/c/docs-page-template5// What changed since: https://ds.interlace.tools/c/docs-page-template#history6// Generated banner — keep it, the upgrade diff reads this version.78/**9 * @interlace/ui — DocsPageTemplate10 *11 * Documentation page surface. Topbar at top, optional sidebar nav on the12 * left (md+), main content in the centre with a `<Prose>` wrapper, and an13 * optional TOC rail on the right (xl+).14 *15 * Used by `ds.interlace.tools` (the registry app's docs pages) and by16 * `apps/docs` (the ESLint plugins docs). One template, two consumers.17 *18 * ## MIN_VIEWPORT — 32019 */2021import { cn } from '@/lib/utils';22import { Container } from '@/components/ui/container';23import { Prose } from '@/components/ui/prose';24import { SectionBoundary } from '@/components/ui/section-boundary';25import { Topbar } from '@/components/ui/patterns/topbar';26import { Footer } from '@/components/ui/patterns/footer';27import { Skeleton } from '@/components/ui/skeleton';28import { Stack } from '@/components/ui/stack';2930export const MIN_VIEWPORT = 320 as const;3132interface DocsPageTemplateProps extends React.ComponentProps<'div'> {33 topbar: React.ComponentProps<typeof Topbar>;34 /** Left sidebar (typically a nav tree). Hidden below md. */35 sidebar?: React.ReactNode;36 /** Right rail (typically a TOC). Hidden below xl. */37 toc?: React.ReactNode;38 /** Page body — wrapped in <Prose>. */39 body: React.ReactNode;40 /** Optional footer at the bottom. */41 footer?: React.ComponentProps<typeof Footer>;42}4344function DocsPageTemplate({45 topbar,46 sidebar,47 toc,48 body,49 footer,50 className,51 ...props52}: DocsPageTemplateProps) {53 return (54 <div55 data-slot="docs-page-template"56 data-min-viewport={String(MIN_VIEWPORT)}57 className={cn(58 'bg-background text-foreground flex min-h-screen flex-col',59 className,60 )}61 {...props}62 >63 <Topbar {...topbar} />6465 <div className="flex flex-1">66 {sidebar ? (67 <aside68 className="border-border bg-card hidden w-64 shrink-0 border-r md:block"69 aria-label="Section navigation"70 >71 <SectionBoundary name="docs-sidebar" skeletonVariant="card">72 {sidebar}73 </SectionBoundary>74 </aside>75 ) : null}7677 <main className="flex-1 px-md py-xl">78// … 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 | |
| Dashboard Templatedashboard-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 |
