descriptions · minimal · 灵感来源:Refactoring UI(实底面板 + 发丝线)
两列:短字段并排
单列:长值不挤
Description List · 极简描述列表 · 描述 / Minimal
做一个 Description List(极简描述列表):
- 同一份 props(items / columns)
- 实底面板 + 发丝边 + shadow-sm,长值阅读优于玻璃
- 语义仍是 dl / dt / dd
用这些 CSS 变量:--color-divider --color-surface --color-text --color-text-muted --color-text-subtle --shadow-sm --text-2xs
灵感参考:Refactoring UI(实底面板 + 发丝线)--color-divider --color-surface --color-text --color-text-muted --color-text-subtle --shadow-sm --text-2xs
(无必缺状态)
(尚未接进整页场景)
/r/descriptions--minimal.json
免外壳的 markdown 版:/llms/components/descriptions--minimal.md--shadow-sm,没有模糊与 inset;长值阅读比玻璃更好dl / dt / dd,两列只在 sm 以上生效import { type ReactNode } from 'react';
interface Props {
items: { label: string; value: ReactNode }[];
columns?: 1 | 2;
className?: string;
}
export function MinimalDescriptions({ items, columns = 1, className = '' }: Props) {
return (
<dl
className={`
grid gap-x-6 gap-y-4 p-5 rounded-md
bg-[var(--color-surface)] border border-[var(--color-divider)]
shadow-[var(--shadow-sm)]
${columns === 2 ? 'sm:grid-cols-2' : ''}
${className}
`}
>
{items.map((item) => (
<div key={item.label} className="min-w-0">
<dt className="text-[length:var(--text-2xs)] uppercase tracking-[0.16em] text-[var(--color-text-subtle)]">
{item.label}
</dt>
<dd className="mt-1 text-sm text-[var(--color-text)] break-words">{item.value}</dd>
</div>
))}
</dl>
);
}
src/components/descriptions/minimal/