Empty
说明空视图的原因,并提供下一步操作。
Angular: 可用 Vue: 可用 React: 可用 React Native: 可用
用法
No meetings yet
Record a meeting and it is transcribed right here, on this device.
This folder is locked
Its notes and transcripts stay encrypted until you unlock it.
Touch ID unlocks it for this session.
<div class="demo-stack">
<sone-empty-state>
<div soneEmptyHeader>
<div soneEmptyMedia variant="icon"><sone-icon icon="meetings" /></div>
<h3 soneEmptyTitle>No meetings yet</h3>
<p soneEmptyDescription>Record a meeting and it is transcribed right here, on this device.</p>
</div>
<div soneEmptyContent>
<div class="demo-row">
<button soneBtn type="button">Start recording</button>
<button soneBtn variant="outline" type="button">Import audio</button>
</div>
</div>
</sone-empty-state>
<!-- Composed: icon / title / description / tone draw the header; projected content follows -->
<sone-empty-state
tone="locked"
title="This folder is locked"
description="Its notes and transcripts stay encrypted until you unlock it."
>
<div soneEmptyContent>
<button soneBtn type="button">Unlock</button>
<p class="text-hint">Touch ID unlocks it for this session.</p>
</div>
</sone-empty-state>
</div>导入
import {
SoneEmptyContentDirective,
SoneEmptyDescriptionDirective,
SoneEmptyDirective,
SoneEmptyHeaderDirective,
SoneEmptyMediaDirective,
SoneEmptyStateComponent,
SoneEmptyTitleDirective,
} from "@surface-one/angular/empty-state";API 参考
SoneEmptyContentDirective指令
SoneEmptyDescriptionDirective指令
SoneEmptyDirective指令
SoneEmptyHeaderDirective指令
SoneEmptyMediaDirective指令
| 名称 | 类型 | 默认值 |
|---|---|---|
variant | EmptyMediaVariant | "default" |
SoneEmptyStateComponent组件
`<sone-empty-state>` — spartan/ui Empty. Two ways to fill it, which combine: - **Slots** — project the parts (`[soneEmptyHeader]` › `[soneEmptyMedia]`, `[soneEmptyTitle]`, `[soneEmptyDescription]`, then `[soneEmptyContent]`). - **Composed** — set `icon`, `title`, `description` and `tone`, and the header is drawn for you; anything projected (actions in `[soneEmptyContent]`, a hint line) follows it. `tone`: `locked` defaults the icon to `lock`; `error` to `alert-circle` and announces with `role="alert"`; `loading` (or `busy`) swaps the media for a spinner and announces with `role="status"`. The effective tone is on the host as `data-tone`.
| 名称 | 类型 | 默认值 |
|---|---|---|
iconThe media glyph. Defaults to `lock` for `tone="locked"`, `alert-circle` for `"error"`. | ShellIcon | null | null |
title | string | null | null |
description | string | null | null |
tone | EmptyStateTone | "default" |
busyShows the loading state (spinner, `role="status"`) whatever the `tone`. | boolean | false |