empty-state · minimal · 灵感来源:Refactoring UI(图标块 + 文字层级)
还没有发布记录
第一次发布后,版本、负责人和回滚点会出现在这里。
没有匹配「dark mode」的记录
换个关键词,或把筛选清掉。
Empty State · 极简空态 · 空态 / Minimal
做一个 Empty State(极简空态):
- 同一份 props(title / description / icon / action)
- 无模糊、无浮起;实底图标砖 + 发丝边,圆角收到 --radius-lg 下一档
- 文案与动作规则同玻璃空态
用这些 CSS 变量:--color-accent --color-divider --color-surface --color-text --color-text-muted --color-text-subtle --text-base --text-xs
灵感参考:Refactoring UI(图标块 + 文字层级)--color-accent --color-divider --color-surface --color-text --color-text-muted --color-text-subtle --text-base --text-xs
(无必缺状态)
(尚未接进整页场景)
/r/empty-state--minimal.json
免外壳的 markdown 版:/llms/components/empty-state--minimal.mdimport { type ReactNode } from 'react';
interface Props {
title: string;
description?: string;
icon?: ReactNode;
/** 一个主操作;多个动作会让空态变成第二个工具栏 */
action?: ReactNode;
className?: string;
}
/** 空态:零数据不是"页面坏了",要说清是什么空了、下一步做什么 */
export function MinimalEmptyState({ title, description, icon, action, className = '' }: Props) {
return (
<div className={`flex flex-col items-center justify-center gap-3 px-6 py-14 text-center ${className}`}>
{icon && (
<div
className="
grid place-items-center size-11 rounded-xl
bg-[var(--color-surface)] border border-[var(--color-divider)]
text-[var(--color-text-subtle)]
"
aria-hidden="true"
>
{icon}
</div>
)}
<p className="text-[length:var(--text-base)] font-medium text-[var(--color-text)]">{title}</p>
{description && (
<p className="text-[length:var(--text-xs)] text-[var(--color-text-muted)] max-w-sm leading-relaxed">
{description}
</p>
)}
{action}
</div>
);
}
src/components/empty-state/minimal/