导航

v2.1.0
营销区块

统计数据

用几个数字为观点提供依据:数字醒目放大,下方配以低调的说明。

统计数据区块用数字说明观点。每个数字下方配一条简短的说明。数字在视觉上充当标题,使用大字号和主要前景色,标签则弱化显示。通常放四项就合适。

统计数据

<section class="container-inline px-lg py-4xl" aria-labelledby="stats-title">  <div class="flex flex-col gap-2xl max-w(1040) mx-auto">    <header class="flex flex-col gap-sm max-w(560)">      <p class="eyebrow">In numbers</p>      <h2 class="heading heading-2xl" id="stats-title">Quiet, at a very large scale.</h2>    </header>    <dl class="grid gap-xl m(0) grid-cols(2) grid-cols(4)@container(--4xl) pt-xl bt(1) bt-solid b-line-hair">      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Deployments a day</dt>        <dd class="m(0) heading heading-2xl">2.4M</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Median build</dt>        <dd class="m(0) heading heading-2xl">38 s</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Regions</dt>        <dd class="m(0) heading heading-2xl">14</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Uptime, last year</dt>        <dd class="m(0) heading heading-2xl">99.99%</dd>      </div>    </dl>  </div></section>
<section className="container-inline px-lg py-4xl" aria-labelledby="stats-title">  <div className="flex flex-col gap-2xl max-w(1040) mx-auto">    <header className="flex flex-col gap-sm max-w(560)">      <p className="eyebrow">In numbers</p>      <h2 className="heading heading-2xl" id="stats-title">Quiet, at a very large scale.</h2>    </header>    <dl className="grid gap-xl m(0) grid-cols(2) grid-cols(4)@container(--4xl) pt-xl bt(1) bt-solid b-line-hair">      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Deployments a day</dt>        <dd className="m(0) heading heading-2xl">2.4M</dd>      </div>      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Median build</dt>        <dd className="m(0) heading heading-2xl">38 s</dd>      </div>      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Regions</dt>        <dd className="m(0) heading heading-2xl">14</dd>      </div>      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Uptime, last year</dt>        <dd className="m(0) heading heading-2xl">99.99%</dd>      </div>    </dl>  </div></section>
<section class="container-inline px-lg py-4xl" aria-labelledby="stats-title">  <div class="flex flex-col gap-2xl max-w(1040) mx-auto">    <header class="flex flex-col gap-sm max-w(560)">      <p class="eyebrow">In numbers</p>      <h2 class="heading heading-2xl" id="stats-title">Quiet, at a very large scale.</h2>    </header>    <dl class="grid gap-xl m(0) grid-cols(2) grid-cols(4)@container(--4xl) pt-xl bt(1) bt-solid b-line-hair">      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Deployments a day</dt>        <dd class="m(0) heading heading-2xl">2.4M</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Median build</dt>        <dd class="m(0) heading heading-2xl">38 s</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Regions</dt>        <dd class="m(0) heading heading-2xl">14</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Uptime, last year</dt>        <dd class="m(0) heading heading-2xl">99.99%</dd>      </div>    </dl>  </div></section>
<template>  <section class="container-inline px-lg py-4xl" aria-labelledby="stats-title">    <div class="flex flex-col gap-2xl max-w(1040) mx-auto">      <header class="flex flex-col gap-sm max-w(560)">        <p class="eyebrow">In numbers</p>        <h2 class="heading heading-2xl" id="stats-title">Quiet, at a very large scale.</h2>      </header>      <dl class="grid gap-xl m(0) grid-cols(2) grid-cols(4)@container(--4xl) pt-xl bt(1) bt-solid b-line-hair">        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Deployments a day</dt>          <dd class="m(0) heading heading-2xl">2.4M</dd>        </div>        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Median build</dt>          <dd class="m(0) heading heading-2xl">38 s</dd>        </div>        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Regions</dt>          <dd class="m(0) heading heading-2xl">14</dd>        </div>        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Uptime, last year</dt>          <dd class="m(0) heading heading-2xl">99.99%</dd>        </div>      </dl>    </div>  </section></template>

区块提供可直接复制的标记,沿用页面的文字颜色和字号。预览在 body 上设置 fg-text-body text-sm。每个区块都是尺寸容器,会根据自身宽度重排。

#区块构成

  • 使用描述列表。 每个标签用 <dt>,对应的数字用 <dd>,两者放在 <dl> 内的同一个 <div> 中,辅助技术会将它们作为一组播报。按描述列表的要求,源码中标签在前。在组上应用 flex-col-reverse 后,数字显示在标签上方。两种顺序都读得通,因此可以安全地调换显示顺序。
  • 数字沿用标题的排版。 在 <dd> 上应用 heading heading-2xl,让数字采用标题的字号、前景色和紧凑字距,同时保留原有语义。
  • 先排两列,再排四列。 使用 grid-cols(2) grid-cols(4)@container(--4xl),区块宽度达到 56rem 时,每行显示四项。
  • 在数据行上方用细线 bt(1) bt-solid b-line-hair 将数字与上方的标题区连在一起。

在应用中展示单个数字,且需要在上方放标签、在旁边显示变化量时,使用 stat 组件。参见仪表盘布局。

#面板式

在同一个托盘中,每个数字各用一个面板,面板间距为 4px。

面板式

<section class="container-inline px-lg py-4xl" aria-label="Atlas in numbers">  <dl class="tray grid gap(4) max-w(1040) mx-auto m(0) grid-cols(2) grid-cols(4)@container(--4xl)">    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Deployments a day</dt>      <dd class="m(0) heading heading-2xl">2.4M</dd>    </div>    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Median build</dt>      <dd class="m(0) heading heading-2xl">38 s</dd>    </div>    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Regions</dt>      <dd class="m(0) heading heading-2xl">14</dd>    </div>    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Uptime, last year</dt>      <dd class="m(0) heading heading-2xl">99.99%</dd>    </div>  </dl></section>
<section className="container-inline px-lg py-4xl" aria-label="Atlas in numbers">  <dl className="tray grid gap(4) max-w(1040) mx-auto m(0) grid-cols(2) grid-cols(4)@container(--4xl)">    <div className="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt className="fg-text-muted">Deployments a day</dt>      <dd className="m(0) heading heading-2xl">2.4M</dd>    </div>    <div className="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt className="fg-text-muted">Median build</dt>      <dd className="m(0) heading heading-2xl">38 s</dd>    </div>    <div className="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt className="fg-text-muted">Regions</dt>      <dd className="m(0) heading heading-2xl">14</dd>    </div>    <div className="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt className="fg-text-muted">Uptime, last year</dt>      <dd className="m(0) heading heading-2xl">99.99%</dd>    </div>  </dl></section>
<section class="container-inline px-lg py-4xl" aria-label="Atlas in numbers">  <dl class="tray grid gap(4) max-w(1040) mx-auto m(0) grid-cols(2) grid-cols(4)@container(--4xl)">    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Deployments a day</dt>      <dd class="m(0) heading heading-2xl">2.4M</dd>    </div>    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Median build</dt>      <dd class="m(0) heading heading-2xl">38 s</dd>    </div>    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Regions</dt>      <dd class="m(0) heading heading-2xl">14</dd>    </div>    <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">      <dt class="fg-text-muted">Uptime, last year</dt>      <dd class="m(0) heading heading-2xl">99.99%</dd>    </div>  </dl></section>
<template>  <section class="container-inline px-lg py-4xl" aria-label="Atlas in numbers">    <dl class="tray grid gap(4) max-w(1040) mx-auto m(0) grid-cols(2) grid-cols(4)@container(--4xl)">      <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">        <dt class="fg-text-muted">Deployments a day</dt>        <dd class="m(0) heading heading-2xl">2.4M</dd>      </div>      <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">        <dt class="fg-text-muted">Median build</dt>        <dd class="m(0) heading heading-2xl">38 s</dd>      </div>      <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">        <dt class="fg-text-muted">Regions</dt>        <dd class="m(0) heading heading-2xl">14</dd>      </div>      <div class="sheet sheet-raised flex flex-col-reverse gap-3xs p-lg">        <dt class="fg-text-muted">Uptime, last year</dt>        <dd class="m(0) heading heading-2xl">99.99%</dd>      </div>    </dl>  </section></template>

#与论点并排

数字用于支撑论点时,把论点放在数字旁边。区块宽度达到 56rem 时,论点文字占一列,四项数据在另一列排成两行两列。

与论点并排

<section class="container-inline px-lg py-4xl" aria-labelledby="stats-split-title">  <div class="grid gap-2xl items-center max-w(1040) mx-auto grid-cols(2)@container(--4xl)">    <header class="flex flex-col gap-sm">      <p class="eyebrow">Reliability</p>      <h2 class="heading heading-2xl" id="stats-split-title">        We publish the numbers we are held to.      </h2>      <p class="lead">        Measured from outside our network, every minute, and posted on a public status page.      </p>      <a class="link self-start mt-xs" href="#">See the status page</a>    </header>    <dl class="grid gap-xl row-gap-2xl grid-cols(2) m(0)">      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Deployments a day</dt>        <dd class="m(0) heading heading-2xl">2.4M</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Median build</dt>        <dd class="m(0) heading heading-2xl">38 s</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Regions</dt>        <dd class="m(0) heading heading-2xl">14</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Uptime, last year</dt>        <dd class="m(0) heading heading-2xl">99.99%</dd>      </div>    </dl>  </div></section>
<section className="container-inline px-lg py-4xl" aria-labelledby="stats-split-title">  <div className="grid gap-2xl items-center max-w(1040) mx-auto grid-cols(2)@container(--4xl)">    <header className="flex flex-col gap-sm">      <p className="eyebrow">Reliability</p>      <h2 className="heading heading-2xl" id="stats-split-title">        We publish the numbers we are held to.      </h2>      <p className="lead">        Measured from outside our network, every minute, and posted on a public status page.      </p>      <a className="link self-start mt-xs" href="#">See the status page</a>    </header>    <dl className="grid gap-xl row-gap-2xl grid-cols(2) m(0)">      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Deployments a day</dt>        <dd className="m(0) heading heading-2xl">2.4M</dd>      </div>      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Median build</dt>        <dd className="m(0) heading heading-2xl">38 s</dd>      </div>      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Regions</dt>        <dd className="m(0) heading heading-2xl">14</dd>      </div>      <div className="flex flex-col-reverse gap-3xs">        <dt className="fg-text-muted">Uptime, last year</dt>        <dd className="m(0) heading heading-2xl">99.99%</dd>      </div>    </dl>  </div></section>
<section class="container-inline px-lg py-4xl" aria-labelledby="stats-split-title">  <div class="grid gap-2xl items-center max-w(1040) mx-auto grid-cols(2)@container(--4xl)">    <header class="flex flex-col gap-sm">      <p class="eyebrow">Reliability</p>      <h2 class="heading heading-2xl" id="stats-split-title">        We publish the numbers we are held to.      </h2>      <p class="lead">        Measured from outside our network, every minute, and posted on a public status page.      </p>      <a class="link self-start mt-xs" href="#">See the status page</a>    </header>    <dl class="grid gap-xl row-gap-2xl grid-cols(2) m(0)">      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Deployments a day</dt>        <dd class="m(0) heading heading-2xl">2.4M</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Median build</dt>        <dd class="m(0) heading heading-2xl">38 s</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Regions</dt>        <dd class="m(0) heading heading-2xl">14</dd>      </div>      <div class="flex flex-col-reverse gap-3xs">        <dt class="fg-text-muted">Uptime, last year</dt>        <dd class="m(0) heading heading-2xl">99.99%</dd>      </div>    </dl>  </div></section>
<template>  <section class="container-inline px-lg py-4xl" aria-labelledby="stats-split-title">    <div class="grid gap-2xl items-center max-w(1040) mx-auto grid-cols(2)@container(--4xl)">      <header class="flex flex-col gap-sm">        <p class="eyebrow">Reliability</p>        <h2 class="heading heading-2xl" id="stats-split-title">          We publish the numbers we are held to.        </h2>        <p class="lead">          Measured from outside our network, every minute, and posted on a public status page.        </p>        <a class="link self-start mt-xs" href="#">See the status page</a>      </header>      <dl class="grid gap-xl row-gap-2xl grid-cols(2) m(0)">        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Deployments a day</dt>          <dd class="m(0) heading heading-2xl">2.4M</dd>        </div>        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Median build</dt>          <dd class="m(0) heading heading-2xl">38 s</dd>        </div>        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Regions</dt>          <dd class="m(0) heading heading-2xl">14</dd>        </div>        <div class="flex flex-col-reverse gap-3xs">          <dt class="fg-text-muted">Uptime, last year</dt>          <dd class="m(0) heading heading-2xl">99.99%</dd>        </div>      </dl>    </div>  </section></template>

#无障碍

  • 把单位和数字一起显示,例如“38 s”“99.99%”,单独读这个数字也能看懂。
  • 如果数字会随时间变化,在它附近标注日期。
  • 不要使用数字递增动画。这会让读者等一会儿才能看到区块要传达的数据,动画本身也没有传达任何信息。