Log Preview
atroui/log-previewFreeBlock
Recent log entries band with view-all link.
Install it
npx shadcn@latest add https://atroui.com/r/log-preview.jsonSource
1import Link from "next/link"23/** Edit entries and labels after install. */4const CONTENT = {5 stamp: "Log",6 viewAllHref: "/log",7 viewAllLabel: "view all →",8}910const ENTRIES = [11 {12 date: "2026-08-01",13 content: "Shipped a narrow personal site kit for the registry.",14 tags: ["ship"],15 },16 {17 date: "2026-07-18",18 content: "Tightened token mapping for hairline lists and mono stamps.",19 tags: ["design"],20 },21 {22 date: "2026-07-04",23 content: "Added command menu and countdown building blocks.",24 tags: ["build"],25 },26]2728function formatDate(iso: string) {29 const d = new Date(iso.length <= 10 ? `${iso}T00:00:00Z` : iso)30 return new Intl.DateTimeFormat("en-US", {31 month: "short",32 day: "2-digit",33 timeZone: "UTC",34 }).format(d)35}3637export function LogPreview({38 stamp = CONTENT.stamp,39 viewAllHref = CONTENT.viewAllHref,40 viewAllLabel = CONTENT.viewAllLabel,41 entries = ENTRIES,42 limit = 5,43 className,44}: {45 stamp?: string46 viewAllHref?: string47 viewAllLabel?: string48 entries?: Array<{ date: string; content: string; tags?: string[] }>49 limit?: number50 className?: string51} = {}) {52 const shown = entries.slice(0, limit)53 if (shown.length === 0) return null5455 return (56 <section className={className ?? "mx-auto max-w-[640px]"}>57 <div className="mb-3 flex items-baseline justify-between">58 <h2 className="font-mono text-[10.5px] tracking-[0.12em] text-muted-foreground uppercase">59 {stamp}60 </h2>61 <Link62 href={viewAllHref}63 className="font-mono text-[11px] text-muted-foreground hover:text-foreground"64 >65 {viewAllLabel}66 </Link>67 </div>6869 <ul className="divide-y divide-border-subtle">70 {shown.map((entry, i) => (71 <li72 key={`${entry.date}-${i}`}73 className="flex gap-4 py-[11px] sm:gap-5"74 >75 <time76 dateTime={entry.date}77 className="w-[56px] shrink-0 pt-[3px] font-mono text-[11px] text-muted-foreground"78 >79 {formatDate(entry.date)}80 </time>81 <div className="min-w-0 flex-1">82 <p className="text-[14.5px] leading-[1.6] text-foreground">83 {entry.content}84 </p>85 {entry.tags && entry.tags.length > 0 ? (86 <div className="mt-1.5 flex flex-wrap gap-1">87 {entry.tags.map((t) => (88 <span89// … truncated
What it pulls in
npm packages
Files it writes
More from atroui
All 81 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Analytics Provideranalytics-provider | atroui | Blocks | Free | 1 dep | |
| AR Portfolioar-portfolio | atroui | Blocks | Free | 1 dep | |
| Before / Afterbefore-after-slider | atroui | Blocks | Free | no deps | |
| Calendly Embedcalendly-embed | atroui | Blocks | Free | 1 dep | |
| Changelogchangelog | atroui | Blocks | Free | no deps | |
| Command Menucommand-menu | atroui | Blocks | Free | 4 deps | |
| Contact Formcontact-form | atroui | Blocks | Free | 2 deps | |
| Contextual CTAcontextual-cta | atroui | Blocks | Free | 2 deps |
