跳到内容
栏目
Fiesta

stack

界面基元 组件无法成为的那些形状,因为它们包住的主体只有调用方知道:卡片、数据网格、菜单,以及外壳自身的框架。

一列按每个区块的类型来留出间距:标题下方紧凑,新一节之前更宽,按钮上方始终留白。里面的元素不会带入自己的外边距。

每个示例都能真实操作,但其中的链接不会跳转到任何地方。 HTML 显示可复制的标记。

由多个部分组成的页面

预览
<div rst-stack>
  <header rst-page-header>
    <div rst-page-header-titles>
      <h1>设置</h1>
      <p rst-page-header-sub>工作区的名称,以及它打开时使用的语言。</p>
    </div>
  </header>
  <section rst-stack rst-section aria-labelledby="stack-profile">
    <h2 id="stack-profile">个人资料</h2>
    <p>更新整个账户里显示的名字和照片。</p>
    <label rst-field-label for="stack-name">显示名称</label>
    <input rst-input type="text" id="stack-name" name="name" aria-describedby="stack-name-help">
    <p rst-field-help id="stack-name-help">显示在你的个人资料上。</p>
    <div rst-actions>
      <button rst-btn="primary" type="submit">保存</button>
      <a rst-btn href="/settings">取消</a>
    </div>
  </section>
  <section rst-stack rst-section aria-labelledby="stack-notifications">
    <h2 id="stack-notifications">通知</h2>
    <p>你参与的讨论每有一条回复就会发送。</p>
    <h3>邮件通知</h3>
    <label rst-field-label for="stack-email">电子邮件</label>
    <input rst-input type="email" id="stack-email" name="email" aria-describedby="stack-email-help">
    <p rst-field-help id="stack-email-help">我们只会用它给你发送回复。</p>
    <p>更改会立即保存。</p>
    <button rst-btn type="submit">保存</button>
  </section>
</div>

在应用里,这会到达 /settings。在这里,它的链接和表单哪儿也不去。