Skip to content

Typography

Font Variant Numeric

Utilities for controlling the variant of numbers.

Quick reference

ClassDescription
normal-numsUnsupported
tabular-numsfont-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif font-variant-numeric: tabular-nums
ordinalfont-variant-numeric: ordinal
slashed-zerofont-variant-numeric: slashed-zero
lining-numsfont-variant-numeric: lining-nums
oldstyle-numsfont-variant-numeric: oldstyle-nums
proportional-numsfont-variant-numeric: proportional-nums

normal-nums not yet supported

This class is not yet supported! If you need this, reach out to us on #nmp-warp-design-system.

Basic usage

Applying numeric variants

Use the tabular-nums to activating the set of figures where numbers are all the same size, allowing them to be easily aligned like in tables. (The font in use has to have support for this, like font-mono).

With tabular-nums + font-mono

#Scientist# Coffee
1Justina Matter1 111 111
2Narve Hoops4 444 444
3Dagny Calamity88 888 888

Without tabular-nums + font-mono

#Scientist# Coffee
1Justina Matter1 111 111
2Narve Hoops4 444 444
3Dagny Calamity88 888 888
html
<table>
  <thead>
    <tr>
      <th>#</th>
      <th>Scientist</th>
      <th># Coffee</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>1</td>
      <td>Justina Matter</td>
      <td class="tabular-nums font-mono ...">1 111 111</td>
    </tr>
    <tr>
      <td>2</td>
      <td>Narve Hoops</td>
      <td class="tabular-nums font-mono ...">4 444 444</td>
    </tr>
    <tr>
      <td>3</td>
      <td>Dagny Calamity</td>
      <td class="tabular-nums font-mono ...">88 888 888</td>
    </tr>
  </tbody>
</table>

Released under the Apache 2.0 License.