Tag Template
interlace-ui/tag-templateFreeBlock
Tag-filtered article index. Used by `/tags/[slug]` routes on a blog to show "all articles tagged #typescript" etc. Shows a header ("Tagged: #typescript") then an ArticleListGrid of matching posts.
Install it
npx shadcn@latest add https://ds.interlace.tools/r/tag-template.jsonSource
1import * as React from 'react';23// @interlace/tag-template v1.1.0 — Interlace design system.4// Docs, props and live preview: https://ds.interlace.tools/c/tag-template5// What changed since: https://ds.interlace.tools/c/tag-template#history6// Generated banner — keep it, the upgrade diff reads this version.78/**9 * @interlace/ui — TagTemplate10 *11 * Tag-filtered article index. Used by `/tags/[slug]` routes on a blog12 * to show "all articles tagged #typescript" etc. Shows a header13 * ("Tagged: #typescript") then an ArticleListGrid of matching posts.14 *15 * ## MIN_VIEWPORT — 32016 */1718import { cn } from '@/lib/utils';19import { Container } from '@/components/ui/container';20import { SectionBoundary } from '@/components/ui/section-boundary';21import { Stack } from '@/components/ui/stack';22import { Tag } from '@/components/ui/tag';23import { Typography } from '@/components/ui/typography';24import { Topbar } from '@/components/ui/patterns/topbar';25import { Footer } from '@/components/ui/patterns/footer';26import { Skeleton } from '@/components/ui/skeleton';2728export const MIN_VIEWPORT = 320 as const;2930interface TagTemplateProps extends Omit<React.ComponentProps<'div'>, 'title'> {31 topbar: React.ComponentProps<typeof Topbar>;32 /** Tag name (rendered in the h1). */33 tagName: string;34 /** Optional URL for the tag chip in the header. */35 tagHref?: string;36 /** Optional one-line lead under the title. */37 lead?: React.ReactNode;38 /** Article grid — typically <ArticleListGrid posts={...} />. */39 articles: React.ReactNode;40 /** Optional sibling-tag cluster for navigation. */41 relatedTags?: React.ReactNode;42 footer?: React.ComponentProps<typeof Footer>;43}4445function TagTemplate({46 topbar,47 tagName,48 tagHref,49 lead,50 articles,51 relatedTags,52 footer,53 className,54 ...props55}: TagTemplateProps) {56 return (57 <div58 data-slot="tag-template"59 data-min-viewport={String(MIN_VIEWPORT)}60 data-tag={tagName}61 className={cn('bg-background text-foreground', className)}62 {...props}63 >64 <Topbar {...topbar} />6566 <main>67 <Container size="content">68 <Stack gap="xl" className="py-xl">69 <SectionBoundary name="tag-header" skeletonVariant="page-header">70 <Stack gap="sm">71 <Typography variant="h1" as="h1" className="text-balance">72 Tagged:{' '}73 <Tag href={tagHref ?? '#'} tone="primary">74 #{tagName}75 </Tag>76// … 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 | |
| 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 |
