Work, side project, home
Keep separate sets of tabs, sign-ins and history, and slide between them without logging out of anything.
A full Dia page: floating pill nav, sunrise hero with a typing window, auto-advancing steps, bento cards, drifting settings switches and a warm closing footer.
Good morning, Aiko.
Three things on deck before lunch.
Today, gently.
Keep separate sets of tabs, sign-ins and history, and slide between them without logging out of anything.
Change a block’s props in place and copy exactly what you see.
Split the window and your layout is remembered for next time.
Meeting notes and the files under discussion open a minute early, with a quiet countdown.
Related tabs gather under one plain name so you see “Pricing page” instead of twelve favicons.
Choose what is remembered and what is never kept. Nothing you build here is sold, and nothing leaves your machine unless you sync it.
Read how data is handled→Drop the file into your project, along with the shared files listed below, and import it.
import { DiaLanding } from "@/registry/blocks/dia-landing";
export function Example() {
return <DiaLanding />;
}Every component here relies only on Tailwind and the cn helper from shadcn/ui.
npm i clsx tailwind-mergeDia · Full page imports these files. Keep the same paths, or update the imports to match.
'use client'
import { useState } from 'react'
import { DiaButton, DiaMark } from '@/registry/blocks/dia-kit'
import { cn } from '@/lib/utils'
export interface DiaNavbarProps {
/** pill: a centred floating capsule. bar: a full-width hairline bar. */
variant?: 'pill' | 'bar'
brand?: string
/** Comma-separated link labels. */
links?: string
ctaLabel?: string
className?: string
}
export function DiaNavbar({ variant = 'pill', brand = 'shinUI', links = 'Blocks, Kits, Changelog', ctaLabel = 'Get started', className }: DiaNavbarProps) {
const [open, setOpen] = useState(false)
const items = links.split(',').map((l) => l.trim()).filter(Boolean)
if (variant === 'bar') {
return (
<header className={cn('border-b border-(--di-line) bg-(--di-paper)/85 backdrop-blur', className)}>
<div className="mx-auto flex h-14 max-w-6xl items-center gap-6 px-6">
<a href="#" className="flex items-center gap-2 text-[15px] font-medium">
<DiaMark />
{brand}
</a>
<nav aria-label="Main" className="hidden flex-1 gap-5 text-[14px] text-(--di-soft) md:flex">
{items.map((l) => (
<a key={l} href="#" className="transition-colors hover:text-(--di-ink)">
{l}
</a>
))}
</nav>
<DiaButton className="ml-auto h-9 px-4 text-[13px]">{ctaLabel}</DiaButton>
</div>
</header>
)
}
return (
<header className={cn('flex justify-center px-4 pt-4', className)}>
<div className="relative flex items-center gap-1 rounded-full border border-(--di-line) bg-(--di-card)/80 p-1 shadow-[0_8px_30px_-16px_rgb(60_40_0/0.4)] backdrop-blur-md">
<a href="#" aria-label={brand} className="grid size-8 place-items-center rounded-full bg-(--di-ink) text-(--di-paper)">
<DiaMark className="size-4" />
</a>
<nav aria-label="Main" className="hidden items-center sm:flex">
{items.map((l) => (
<a key={l} href="#" className="rounded-full px-3 py-1.5 text-[13px] text-(--di-soft) transition-colors hover:bg-(--di-chip) hover:text-(--di-ink)">
{l}
</a>
))}
</nav>
<button
type="button"
aria-expanded={open}
aria-label="Menu"
onClick={() => setOpen((o) => !o)}
className="rounded-full px-3 py-1.5 text-[13px] text-(--di-soft) sm:hidden"
>
Menu
</button>
{open && (
<nav aria-label="Mobile" className="absolute inset-x-0 top-full mt-2 flex flex-col rounded-2xl border border-(--di-line) bg-(--di-card) p-2 shadow-lg sm:hidden">
{items.map((l) => (
<a key={l} href="#" className="rounded-xl px-3 py-2 text-[14px] hover:bg-(--di-chip)">
{l}
</a>
))}
</nav>
)}
<a href="#" className="rounded-full bg-(--di-chip) px-3 py-1.5 text-[13px] font-medium transition-colors hover:bg-(--di-honey)">
{ctaLabel}
</a>
</div>
</header>
)
}
'use client'
import { useEffect, useState } from 'react'
import { DiaButton, DiaHeading, Lines, Sunrise, WindowFrame } from '@/registry/blocks/dia-kit'
import { cn } from '@/lib/utils'
export interface DiaHeroProps {
/** sunrise: gold glow, giant serif wordmark and a window. plain: paper background, headline and window. */
variant?: 'sunrise' | 'plain'
brand?: string
title?: string
primaryCta?: string
note?: string
/** What the assistant in the window types out. */
prompt?: string
animate?: boolean
className?: string
}
const AGENDA = [
{ time: '09:30', label: 'Review hero variants', tag: 'Blocks' },
{ time: '11:00', label: 'Pair on the pricing table', tag: 'Call' },
{ time: '14:15', label: 'Ship the footer kit', tag: 'Release' },
]
function useTyped(text: string, on: boolean) {
const [n, setN] = useState(0)
useEffect(() => {
if (!on) return
if (window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
const t = window.setTimeout(() => setN(text.length), 0)
return () => window.clearTimeout(t)
}
const id = window.setInterval(() => setN((v) => (v >= text.length + 40 ? 0 : v + 1)), 55)
return () => window.clearInterval(id)
}, [text, on])
return on ? text.slice(0, Math.min(n, text.length)) : text
}
function HeroWindow({ prompt, animate }: { prompt: string; animate: boolean }) {
const typed = useTyped(prompt, animate)
return (
<WindowFrame tabs={['Today', 'Hero variants', 'Pricing notes']} className="mt-8 w-full max-w-3xl text-left">
<div className="grid min-h-[300px] grid-cols-1 sm:grid-cols-[180px_1fr]">
<aside className="hidden flex-col gap-1 border-r border-(--di-line) bg-(--di-paper)/60 p-3 text-[12px] sm:flex">
{['Morning plan', 'Inbox digest', 'Pinned specs', 'Drafts'].map((x, i) => (
<span key={x} className={cn('rounded-lg px-2.5 py-1.5', i === 0 ? 'bg-(--di-honey)/60 font-medium' : 'text-(--di-soft)')}>
{x}
</span>
))}
</aside>
<div className="flex flex-col gap-4 p-5">
<div>
<p className="font-(family-name:--di-serif) text-[22px] tracking-tight">Good morning, Aiko.</p>
<p className="text-[12px] text-(--di-soft)">Three things on deck before lunch.</p>
</div>
<ul className="flex flex-col gap-1.5">
{AGENDA.map((a, i) => (
<li
key={a.time}
className={cn('flex items-center gap-3 rounded-xl border border-(--di-line) px-3 py-2 text-[12.5px]', animate && 'di-anim [animation:di-rise_.6s_ease-out_both]')}
style={{ animationDelay: `${200 + i * 140}ms` }}
>
<span className="font-mono text-[11px] text-(--di-faint)">{a.time}</span>
<span className="flex-1 truncate">{a.label}</span>
<span className="rounded-full bg-(--di-chip) px-2 py-0.5 text-[10.5px] text-(--di-soft)">{a.tag}</span>
</li>
))}
</ul>
<div className="mt-auto flex items-center gap-2 rounded-xl bg-(--di-chip) px-3 py-2.5 text-[12.5px]">
<span className="size-2 rounded-full bg-(--di-sun)" />
<span className="min-w-0 flex-1 truncate">
{typed}
<span className="di-anim ml-px inline-block h-3.5 w-px translate-y-0.5 bg-(--di-ink) [animation:di-caret_1s_steps(1)_infinite]" />
</span>
</div>
</div>
</div>
</WindowFrame>
)
}
export function DiaHero({
variant = 'sunrise',
brand = 'shinUI',
title = 'Less tab juggling.\nMore good pages.',
primaryCta = 'Start building',
note = 'Free, open source, copy-paste React',
prompt = 'Summarise yesterday’s review and open the hero file…',
animate = true,
className,
}: DiaHeroProps) {
const sun = variant === 'sunrise'
return (
<section className={cn('relative isolate overflow-hidden px-6 pt-16 pb-20', className)}>
{sun && <Sunrise animate={animate} className="-z-10" />}
<div className="mx-auto flex max-w-5xl flex-col items-center text-center">
<DiaHeading as="h1" className={cn('text-[34px] leading-[1.08] sm:text-[44px]', sun && 'text-[#2a2208] dark:text-(--di-ink)')}>
<Lines text={title} />
</DiaHeading>
{sun && (
<p aria-hidden className="mt-2 font-(family-name:--di-serif) text-[clamp(88px,18vw,220px)] leading-[0.9] tracking-[-0.06em] text-white/90 italic mix-blend-soft-light dark:text-white/30">
{brand}
</p>
)}
<HeroWindow prompt={prompt} animate={animate} />
{primaryCta && (
<div className="mt-10 flex flex-col items-center gap-2">
<DiaButton>{primaryCta}</DiaButton>
<span className="text-[12px] text-(--di-faint)">{note}</span>
</div>
)}
</div>
</section>
)
}
'use client'
import { useEffect, useState } from 'react'
import { DiaHeading, Eyebrow, WindowFrame } from '@/registry/blocks/dia-kit'
import { cn } from '@/lib/utils'
export interface DiaStepsProps {
title?: string
/** Auto-advance through the steps; clicking one takes over. */
animate?: boolean
/** Seconds per step when auto-advancing. */
interval?: number
className?: string
}
const STEPS = [
{
title: 'Open the day with a plan',
body: 'A short morning page lists what changed overnight, which reviews wait on you and the files you touched last, so the first coffee goes to work and not to searching.',
},
{
title: 'Turn scattered notes into one page',
body: 'Feedback lives in threads, docs and screenshots. Pull it into a single tidy summary you can paste into the pull request or hand to a teammate.',
},
{
title: 'Ask, and land on the right file',
body: 'Type the question the way you would ask a colleague. The answer points at the exact block, prop and line, with the source one click away.',
},
]
function Panel({ step }: { step: number }) {
if (step === 0) {
return (
<div className="relative overflow-hidden rounded-xl bg-[linear-gradient(160deg,var(--di-honey),var(--di-cream))] p-6">
<Eyebrow className="text-[#5a4a10]/70 dark:text-(--di-faint)">Thursday · Morning page</Eyebrow>
<p className="mt-3 font-(family-name:--di-serif) text-[34px] leading-none tracking-tight italic">Today, gently.</p>
<ul className="mt-6 grid gap-2 text-[13px]">
{['2 reviews waiting on you', 'Footer kit merged overnight', 'Last opened: hero-variants.tsx'].map((x) => (
<li key={x} className="flex items-center gap-2 rounded-lg bg-white/70 px-3 py-2 dark:bg-black/20">
<span className="size-1.5 rounded-full bg-(--di-ink)" />
{x}
</li>
))}
</ul>
</div>
)
}
if (step === 1) {
return (
<div className="p-6">
<Eyebrow>Summary · Review round 3</Eyebrow>
<p className="mt-3 font-(family-name:--di-serif) text-[28px] leading-tight tracking-tight">What we agreed on</p>
<div className="mt-4 space-y-2 text-[13px] leading-relaxed text-(--di-soft)">
<p>Keep the serif for headlines only; body stays sans at 15px.</p>
<p>The glow should drift, never pulse. Reduced motion freezes it.</p>
<p>Cards lose their shadow on dark, borders carry the shape.</p>
</div>
<div className="mt-5 flex gap-2">
{['3 threads', '2 docs', '5 screenshots'].map((x) => (
<span key={x} className="rounded-full bg-(--di-chip) px-2.5 py-1 text-[11px] text-(--di-soft)">
{x}
</span>
))}
</div>
</div>
)
}
return (
<div className="flex flex-col gap-3 p-6 text-[13px]">
<span className="self-end rounded-2xl rounded-br-md bg-(--di-ink) px-3.5 py-2 text-(--di-paper)">Where is the sticky nav offset set?</span>
<span className="max-w-[90%] rounded-2xl rounded-bl-md bg-(--di-chip) px-3.5 py-2 leading-relaxed">
In <code className="font-mono text-[12px]">components-browser.tsx</code>, on the wrapper around the tab list. It matches the header height at each breakpoint.
</span>
<span className="flex items-center gap-2 self-start rounded-lg border border-(--di-line) px-3 py-2 font-mono text-[11.5px] text-(--di-soft)">
<span className="size-1.5 rounded-full bg-(--di-sun)" />
Open file at line 64
</span>
</div>
)
}
export function DiaSteps({ title = 'Fewer tabs, more flow', animate = true, interval = 6, className }: DiaStepsProps) {
const [active, setActive] = useState(0)
const [auto, setAuto] = useState(animate)
useEffect(() => {
if (!auto || window.matchMedia('(prefers-reduced-motion: reduce)').matches) return
const id = window.setTimeout(() => setActive((a) => (a + 1) % STEPS.length), interval * 1000)
return () => window.clearTimeout(id)
}, [auto, active, interval])
return (
<section className={cn('px-6 py-24', className)}>
<div className="mx-auto max-w-6xl">
<DiaHeading className="text-center text-[34px] leading-tight sm:text-[42px]">{title}</DiaHeading>
<div className="mt-14 grid items-center gap-10 md:grid-cols-[minmax(0,5fr)_minmax(0,6fr)]">
<ol className="flex flex-col">
{STEPS.map((s, i) => {
const on = i === active
return (
<li key={s.title} className="border-t border-(--di-line) last:border-b">
<button
type="button"
aria-expanded={on}
onClick={() => {
setAuto(false)
setActive(i)
}}
className="group flex w-full flex-col gap-2 py-5 text-left focus-visible:outline-none"
>
<span className="flex items-baseline gap-4">
<Eyebrow>{String(i + 1).padStart(2, '0')}</Eyebrow>
<span className={cn('font-(family-name:--di-serif) text-[22px] tracking-tight transition-colors', on ? 'text-(--di-ink)' : 'text-(--di-faint) group-hover:text-(--di-soft)')}>{s.title}</span>
</span>
<span className={cn('grid pl-10 transition-[grid-template-rows,opacity] duration-500 ease-out', on ? 'grid-rows-[1fr] opacity-100' : 'grid-rows-[0fr] opacity-0')}>
<span className="overflow-hidden text-[14.5px] leading-relaxed text-(--di-soft)">{s.body}</span>
</span>
{on && auto && (
<span className="ml-10 h-px overflow-hidden bg-(--di-line)">
<span key={active} className="di-anim block h-full origin-left bg-(--di-ink)" style={{ animation: `di-fill ${interval}s linear both` }} />
</span>
)}
</button>
</li>
)
})}
</ol>
<WindowFrame tabs={['Morning page', 'Summary', 'Ask']} active={active}>
<div key={active} className="di-anim min-h-[320px] [animation:di-rise_.5s_ease-out_both]">
<Panel step={active} />
</div>
</WindowFrame>
</div>
</div>
</section>
)
}
import type { ReactNode } from 'react'
import { DiaHeading, Eyebrow } from '@/registry/blocks/dia-kit'
import { cn } from '@/lib/utils'
export interface DiaBentoProps {
title?: string
className?: string
}
function Card({ label, title, body, wide, children }: { label: string; title: string; body: string; wide?: boolean; children: ReactNode }) {
return (
<article
className={cn(
'group flex flex-col overflow-hidden rounded-2xl border border-(--di-line) bg-(--di-card) transition-[transform,box-shadow] duration-500 ease-out hover:-translate-y-1 hover:shadow-[0_30px_60px_-36px_rgb(60_40_0/0.45)]',
wide && 'md:col-span-2',
)}
>
<div className="relative h-44 overflow-hidden border-b border-(--di-line) bg-(--di-paper)">{children}</div>
<div className="flex flex-col gap-1.5 p-5">
<Eyebrow>{label}</Eyebrow>
<h3 className="font-(family-name:--di-serif) text-[21px] tracking-tight">{title}</h3>
<p className="text-[14px] leading-relaxed text-(--di-soft)">{body}</p>
</div>
</article>
)
}
const pill = 'rounded-md border border-(--di-line) bg-(--di-card) px-2 py-1 text-[11px] shadow-sm'
export function DiaBento({ title = 'Shaped around a working day', className }: DiaBentoProps) {
return (
<section className={cn('px-6 py-24', className)}>
<div className="mx-auto max-w-6xl">
<DiaHeading className="text-center text-[34px] leading-tight sm:text-[42px]">{title}</DiaHeading>
<div className="mt-14 grid gap-4 md:grid-cols-3">
<Card wide label="Spaces" title="Work, side project, home" body="Keep separate sets of tabs, sign-ins and history, and slide between them without logging out of anything.">
<div className="absolute inset-0 flex items-center justify-center gap-3 p-6">
{[
['Studio', 'bg-(--di-honey)'],
['Side quest', 'bg-(--di-lime)'],
['Home', 'bg-(--di-chip)'],
].map(([n, c], i) => (
<div key={n} className={cn('flex h-28 w-36 flex-col justify-end rounded-xl p-3 text-[12px] font-medium transition-transform duration-500 group-hover:-translate-y-1', c)} style={{ transitionDelay: `${i * 60}ms` }}>
{n}
</div>
))}
</div>
</Card>
<Card label="Live props" title="Tweak, then copy" body="Change a block’s props in place and copy exactly what you see.">
<div className="absolute inset-0 flex flex-col justify-center gap-2 px-8">
{[72, 40, 88].map((w, i) => (
<div key={i} className="h-1.5 rounded-full bg-(--di-chip)">
<div className="h-full rounded-full bg-(--di-ink) transition-[width] duration-700 group-hover:w-full" style={{ width: `${w}%` }} />
</div>
))}
</div>
</Card>
<Card label="Side by side" title="Preview next to source" body="Split the window and your layout is remembered for next time.">
<div className="absolute inset-4 grid grid-cols-2 gap-2">
<div className="rounded-lg bg-[linear-gradient(160deg,var(--di-honey),var(--di-cream))]" />
<div className="space-y-1.5 rounded-lg border border-(--di-line) bg-(--di-card) p-3">
{[90, 70, 80, 50, 65].map((w, i) => (
<div key={i} className="h-1 rounded bg-(--di-ink)/15" style={{ width: `${w}%` }} />
))}
</div>
</div>
</Card>
<Card label="Before the call" title="The right page, already open" body="Meeting notes and the files under discussion open a minute early, with a quiet countdown.">
<div className="absolute inset-0 grid place-items-center">
<div className="flex flex-col items-center gap-2">
<span className="font-(family-name:--di-serif) text-[44px] leading-none tracking-tight">0:58</span>
<span className={pill}>Design review · starting soon</span>
</div>
</div>
</Card>
<Card label="Tidy tabs" title="Named groups, not a strip of icons" body="Related tabs gather under one plain name so you see “Pricing page” instead of twelve favicons.">
<div className="absolute inset-0 flex flex-col justify-center gap-2 px-6">
{['Pricing page · 4', 'Footer kit · 3', 'Reading · 6'].map((g, i) => (
<span key={g} className={cn(pill, 'w-fit transition-transform duration-500 group-hover:translate-x-2')} style={{ transitionDelay: `${i * 70}ms` }}>
{g}
</span>
))}
</div>
</Card>
</div>
</div>
</section>
)
}
'use client'
import { useState } from 'react'
import { DiaHeading } from '@/registry/blocks/dia-kit'
import { cn } from '@/lib/utils'
export interface DiaControlsProps {
title?: string
body?: string
linkLabel?: string
animate?: boolean
className?: string
}
const SETTINGS: [string, boolean][] = [
['Remember my layout', true],
['Share usage stats', false],
['Local history only', true],
['Load remote fonts', false],
['Block third-party scripts', true],
['Sync across devices', true],
['Suggest next steps', false],
['Keep drafts offline', true],
]
/** A row of switches that drifts sideways. The switches really toggle. */
function Row({ items, reverse, animate, on, toggle }: { items: string[]; reverse?: boolean; animate: boolean; on: Record<string, boolean>; toggle: (k: string) => void }) {
return (
<div className="group/row flex overflow-hidden [mask-image:linear-gradient(90deg,transparent,black_12%,black_88%,transparent)]">
<div
className={cn('flex shrink-0 gap-3 pr-3 group-hover/row:[animation-play-state:paused] group-focus-within/row:[animation-play-state:paused]', animate && 'di-anim')}
// Longhands, not the shorthand: an inline `animation` would reset
// play-state and stop the hover pause from working.
style={
animate
? { animationName: 'di-marquee', animationDuration: `${reverse ? 46 : 38}s`, animationTimingFunction: 'linear', animationIterationCount: 'infinite', animationDirection: reverse ? 'reverse' : 'normal' }
: undefined
}
>
{[0, 1].map((copy) =>
items.map((k) => (
<button
key={`${copy}-${k}`}
type="button"
role="switch"
aria-checked={on[k]}
tabIndex={copy ? -1 : 0}
aria-hidden={copy ? true : undefined}
onClick={() => toggle(k)}
className="flex shrink-0 items-center gap-3 rounded-full border border-(--di-line) bg-(--di-card) py-1.5 pr-1.5 pl-4 text-[13px] whitespace-nowrap focus-visible:ring-2 focus-visible:ring-(--di-sun) focus-visible:outline-none"
>
{k}
<span className={cn('flex h-5 w-9 items-center rounded-full p-0.5 transition-colors duration-300', on[k] ? 'bg-(--di-ink)' : 'bg-(--di-chip)')}>
<span className={cn('size-4 rounded-full bg-(--di-card) shadow transition-transform duration-300', on[k] && 'translate-x-4')} />
</span>
</button>
)),
)}
</div>
</div>
)
}
export function DiaControls({
title = 'Your settings,\nyour call',
body = 'Choose what is remembered and what is never kept. Nothing you build here is sold, and nothing leaves your machine unless you sync it.',
linkLabel = 'Read how data is handled',
animate = true,
className,
}: DiaControlsProps) {
const [on, setOn] = useState<Record<string, boolean>>(() => Object.fromEntries(SETTINGS))
const toggle = (k: string) => setOn((s) => ({ ...s, [k]: !s[k] }))
const names = SETTINGS.map(([k]) => k)
const [first, second] = title.split('\n')
return (
<section className={cn('overflow-hidden py-24', className)}>
<DiaHeading className="px-6 text-center text-[34px] leading-tight sm:text-[42px]">{first}</DiaHeading>
<div className="mt-8 flex flex-col gap-3">
<Row items={names.slice(0, 4)} animate={animate} on={on} toggle={toggle} />
<Row items={names.slice(4)} reverse animate={animate} on={on} toggle={toggle} />
</div>
{second && <DiaHeading className="mt-8 px-6 text-center text-[34px] leading-tight sm:text-[42px]">{second}</DiaHeading>}
<div className="mx-auto mt-6 flex max-w-xl flex-col items-center gap-5 px-6 text-center">
<p className="text-[15px] leading-relaxed text-(--di-soft)">{body}</p>
<a href="#" className="group inline-flex items-center gap-2 rounded-full border border-(--di-line) px-4 py-2 text-[13px] transition-colors hover:bg-(--di-chip)">
{linkLabel}
<span className="transition-transform group-hover:translate-x-0.5">→</span>
</a>
</div>
</section>
)
}
import { DiaButton, DiaHeading, DiaMark, Eyebrow, Sunrise } from '@/registry/blocks/dia-kit'
import { cn } from '@/lib/utils'
export interface DiaFooterProps {
/** cta: closing headline, sticky arch dock and link columns. columns: links only. */
variant?: 'cta' | 'columns'
brand?: string
headline?: string
ctaLabel?: string
note?: string
animate?: boolean
className?: string
}
const COLUMNS: [string, string[]][] = [
['Library', ['Blocks', 'Components', 'Kits', 'Changelog']],
['Learn', ['Install', 'Theming', 'Accessibility', 'FAQ']],
['Project', ['GitHub', 'Roadmap', 'License', 'Contact']],
]
/**
* The arch-shaped download dock. It is `position: sticky; bottom: 0`, so it
* pins to the bottom of whatever scrolls (the window, or a preview frame)
* while the page moves underneath, and settles into place at the end.
* Render it as a direct child of the long page container so it can stick
* for the whole scroll.
*/
export function DiaDock({ ctaLabel = 'Start building', note = 'Works with Next.js, Vite and Remix', className }: { ctaLabel?: string; note?: string; className?: string }) {
return (
<div className={cn('pointer-events-none sticky bottom-0 z-20 h-40 overflow-x-clip', className)}>
<div aria-hidden className="absolute inset-x-[-15%] bottom-0 h-full rounded-t-[50%] bg-(--di-paper) shadow-[0_-1px_0_var(--di-line),0_-24px_48px_-28px_rgb(60_40_0/0.35)]" />
<div className="pointer-events-auto relative flex h-full flex-col items-center justify-center gap-2 pt-6">
<DiaButton className="h-12 min-w-64 px-8">{ctaLabel}</DiaButton>
<span className="text-[12px] text-(--di-soft)">{note}</span>
</div>
</div>
)
}
export function DiaFooterColumns({ brand = 'shinUI', className }: { brand?: string; className?: string }) {
return (
<footer className={cn('relative z-30 border-t border-(--di-line) bg-(--di-paper)', className)}>
<div className="mx-auto grid max-w-6xl gap-10 px-6 py-14 sm:grid-cols-2 md:grid-cols-[1.4fr_repeat(3,1fr)]">
<div className="flex flex-col gap-3">
<a href="#" className="flex items-center gap-2 text-[15px] font-medium">
<DiaMark />
{brand}
</a>
<p className="max-w-[24ch] text-[13px] leading-relaxed text-(--di-soft)">Calm, original blocks for pages people enjoy using.</p>
</div>
{COLUMNS.map(([h, links]) => (
<nav key={h} aria-label={h} className="flex flex-col gap-2.5">
<Eyebrow>{h}</Eyebrow>
{links.map((l) => (
<a key={l} href="#" className="w-fit text-[13.5px] text-(--di-soft) transition-colors hover:text-(--di-ink)">
{l}
</a>
))}
</nav>
))}
</div>
<div className="mx-auto flex max-w-6xl flex-wrap items-center justify-between gap-3 border-t border-(--di-line) px-6 py-5">
<Eyebrow>© {brand}</Eyebrow>
<Eyebrow>Made slowly, on purpose</Eyebrow>
</div>
</footer>
)
}
/**
* cta: a closing headline, the sticky arch dock and the link columns. It
* returns siblings (no wrapper) so the dock sticks across the whole page it
* is placed in. columns: links only.
*/
export function DiaFooter({
variant = 'cta',
brand = 'shinUI',
headline = 'Ready for an easier build?',
ctaLabel = 'Start building',
note = 'Works with Next.js, Vite and Remix',
animate = true,
className,
}: DiaFooterProps) {
if (variant === 'columns') return <DiaFooterColumns brand={brand} className={className} />
return (
<>
<section className={cn('relative isolate overflow-hidden px-6 pt-28 pb-4 text-center', className)}>
<Sunrise animate={animate} horizon={false} className="-z-10 [mask-image:radial-gradient(60%_80%_at_50%_100%,black,transparent)] opacity-70" />
<DiaHeading className="text-[38px] leading-tight sm:text-[52px]">{headline}</DiaHeading>
</section>
<DiaDock ctaLabel={ctaLabel} note={note} />
<DiaFooterColumns brand={brand} />
</>
)
}
'use client'
import type { ComponentProps, ReactNode } from 'react'
import { cn } from '@/lib/utils'
/**
* Dia Kit: shared pieces behind the shinUI "Dia" blocks.
*
* A calm, sunlit workday look: warm paper background, a honey-gold glow that
* rises behind the hero, soft serif headlines with tight tracking over a
* plain sans body, ink pill buttons, white cards with hairline borders, and
* a browser window mockup built in plain markup. Wrap blocks in <DiaRoot>.
*/
const VARS = [
'[--di-paper:#fbfaf6] [--di-card:#ffffff] [--di-ink:#1b1a17] [--di-soft:rgb(27_26_23/0.64)] [--di-faint:rgb(27_26_23/0.42)] [--di-line:rgb(27_26_23/0.09)]',
'[--di-sun:#ffc93d] [--di-honey:#ffe27a] [--di-cream:#fff4cc] [--di-chip:#f2f0e8] [--di-lime:#eef9b8]',
'[--di-serif:ui-serif,"Iowan_Old_Style","Palatino_Linotype",Georgia,serif]',
'dark:[--di-paper:#14130f] dark:[--di-card:#1d1c17] dark:[--di-ink:#f6f3ea] dark:[--di-soft:rgb(246_243_234/0.66)] dark:[--di-faint:rgb(246_243_234/0.42)] dark:[--di-line:rgb(255_255_255/0.09)]',
'dark:[--di-sun:#e2a516] dark:[--di-honey:#8a6a1c] dark:[--di-cream:#2a2416] dark:[--di-chip:#24221c] dark:[--di-lime:#2e3315]',
].join(' ')
const KEYFRAMES = `
@keyframes di-drift{0%,100%{transform:translate3d(-3%,0,0) scale(1)}50%{transform:translate3d(3%,-4%,0) scale(1.06)}}
@keyframes di-rise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:none}}
@keyframes di-marquee{from{transform:translateX(0)}to{transform:translateX(-50%)}}
@keyframes di-caret{50%{opacity:0}}
@keyframes di-fill{from{transform:scaleX(0)}to{transform:scaleX(1)}}
@media (prefers-reduced-motion:reduce){.di-anim{animation:none!important}}
`
export function DiaRoot({ className, children, ...props }: ComponentProps<'div'>) {
return (
<div className={cn(VARS, 'bg-(--di-paper) font-sans text-(--di-ink) antialiased', className)} {...props}>
<style>{KEYFRAMES}</style>
{children}
</div>
)
}
/** Soft serif headline with tight tracking. */
export function DiaHeading({ as: Tag = 'h2', className, children }: { as?: 'h1' | 'h2' | 'h3'; className?: string; children: ReactNode }) {
return <Tag className={cn('font-(family-name:--di-serif) font-normal tracking-[-0.035em] text-balance', className)}>{children}</Tag>
}
/** Splits on "\n" so authors control line breaks. */
export function Lines({ text }: { text: string }) {
return (
<>
{text.split('\n').map((l, i) => (
<span key={i} className="block">
{l}
</span>
))}
</>
)
}
export function DiaButton({ variant = 'ink', className, children, ...props }: ComponentProps<'a'> & { variant?: 'ink' | 'light' | 'ghost' }) {
return (
<a
href="#"
className={cn(
'inline-flex h-11 items-center justify-center gap-2 rounded-full px-6 text-[14px] font-medium whitespace-nowrap transition-[transform,background-color,box-shadow] duration-300 ease-out hover:-translate-y-px active:translate-y-0 focus-visible:ring-2 focus-visible:ring-(--di-sun) focus-visible:outline-none',
variant === 'ink' && 'bg-(--di-ink) text-(--di-paper) shadow-[0_10px_24px_-12px_rgb(0_0_0/0.5)] hover:shadow-[0_16px_30px_-14px_rgb(0_0_0/0.55)]',
variant === 'light' && 'border border-(--di-line) bg-(--di-card) text-(--di-ink)',
variant === 'ghost' && 'px-3 text-(--di-soft) hover:text-(--di-ink)',
className,
)}
{...props}
>
{children}
</a>
)
}
/** Original mark: a half sun resting on a line. */
export function DiaMark({ className }: { className?: string }) {
return (
<svg viewBox="0 0 20 20" className={cn('size-5', className)} fill="none" aria-hidden>
<path d="M3.5 13a6.5 6.5 0 0113 0z" fill="currentColor" />
<path d="M1.5 15.5h17" stroke="currentColor" strokeWidth={1.6} strokeLinecap="round" />
</svg>
)
}
/** A warm glow that slowly drifts, with a cream horizon curve at the bottom. */
export function Sunrise({ animate = true, horizon = true, className }: { animate?: boolean; horizon?: boolean; className?: string }) {
return (
<div aria-hidden className={cn('pointer-events-none absolute inset-0 overflow-hidden', className)}>
<div className="absolute inset-0 bg-[linear-gradient(180deg,var(--di-sun)_0%,var(--di-honey)_45%,var(--di-cream)_80%)]" />
<div
className={cn('absolute -inset-x-1/4 top-[10%] h-[80%] rounded-[50%] bg-[radial-gradient(closest-side,rgb(255_255_255/0.75),transparent)] blur-2xl', animate && 'di-anim')}
style={{ animation: animate ? 'di-drift 14s ease-in-out infinite' : undefined }}
/>
<div
className={cn('absolute -right-1/4 -bottom-1/4 size-[70%] rounded-full bg-[radial-gradient(closest-side,rgb(255_170_0/0.45),transparent)] blur-3xl', animate && 'di-anim')}
style={{ animation: animate ? 'di-drift 18s ease-in-out -6s infinite reverse' : undefined }}
/>
{horizon && <div className="absolute -inset-x-[20%] -bottom-[38%] h-[60%] rounded-[50%] bg-(--di-paper)" />}
</div>
)
}
/** A browser window with traffic lights and a tab strip; content is yours. */
export function WindowFrame({ tabs = ['Today'], active = 0, className, children }: { tabs?: string[]; active?: number; className?: string; children: ReactNode }) {
return (
<div className={cn('overflow-hidden rounded-2xl border border-(--di-line) bg-(--di-card) shadow-[0_40px_90px_-40px_rgb(60_40_0/0.45)]', className)}>
<div className="flex items-center gap-3 border-b border-(--di-line) bg-(--di-chip) px-3 py-2">
<span className="flex gap-1.5">
{[0, 1, 2].map((i) => (
<span key={i} className="size-2.5 rounded-full bg-(--di-ink)/15" />
))}
</span>
<span className="flex min-w-0 gap-1">
{tabs.map((t, i) => (
<span key={t} className={cn('truncate rounded-md px-2.5 py-1 text-[11px]', i === active ? 'bg-(--di-card) text-(--di-ink) shadow-sm' : 'text-(--di-faint)')}>
{t}
</span>
))}
</span>
</div>
{children}
</div>
)
}
/** Small mono label used for numbers and eyebrows. */
export function Eyebrow({ className, children }: { className?: string; children: ReactNode }) {
return <span className={cn('font-mono text-[11px] tracking-[0.14em] text-(--di-faint) uppercase', className)}>{children}</span>
}
Bento Grid
A responsive bento layout that collapses to a single column on mobile, with per-card column and row spans and a hover glow that scales from the corner.
Timeline
A vertical timeline with a brand dot per milestone and a left rule — enough structure for changelogs, roadmaps and onboarding steps.
ASCII Footer
The brand set in monospace characters that shimmer in a slow wave and scramble under the cursor, or an ASCII sunset sea.