跳至正文

Empty

A static empty collection message with a heading, explanation, and next step.

浏览器
Chrome 123+Firefox 121+Safari 17.5+
层级
0
强制布局预算
0 ms
axe 预算
0
支持 SSR
是
公开契约
测试环境

交互示例

Empty

No projects yet

Create a project to organize your work and invite your team.

示例

No projects

Use the static composition for an empty collection and provide a clear next step.

No projects yet

Create a project to organize your work and invite your team.

import { Button, Empty, EmptyContent, EmptyDescription, EmptyTitle } from "@gunkin/uiify";

export default function Example() {
  return (
    <Empty>
      <EmptyTitle>No projects yet</EmptyTitle>
      <EmptyDescription>Create a project to organize your work and invite your team.</EmptyDescription>
      <EmptyContent><Button as="a" href="/projects/new" variant="link">Create a project</Button></EmptyContent>
    </Empty>
  );
}

API

Empty

属性类型默认值说明
childrenReactNode—Title, description, and optional next-step content.
className / style / ref / native section propsnative section props—Native section props, styles, events, and ref are forwarded.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

EmptyTitle

属性类型默认值说明
childrenReactNode—Content for this semantic empty-state part.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

EmptyDescription

属性类型默认值说明
childrenReactNode—Content for this semantic empty-state part.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

EmptyContent

属性类型默认值说明
childrenReactNode—Content for this semantic empty-state part.
renderReactElement | ((props, state) => ReactElement)—替换渲染元素,同时保留行为和无障碍连接关系。

键盘

按键操作

无障碍

Static section with heading, description, and optional content. It does not announce as status or alert; keep the empty state understandable in visible text and use a native link or button for its next step.

样式钩子

data-uiify-emptydata-uiify-empty-titledata-uiify-empty-descriptiondata-uiify-empty-contentdata-part