Blocks Design System

Measure

Caps text at a readable line length, roughly 45 to 80 characters, and centers it. Use it around articles, guides and long form fields; layout components take the full width.

tsx
import { Measure } from '@blocks/design-system'

Usage

Wrap long text. Measure renders a <div> unless you pass as, so an article can be the Measure itself.

Reading a snow course

A snow course is a line of marked points where observers measure depth and water content by hand. The same points are sampled near the first of each month, so a season’s readings can be compared with decades of earlier ones without worrying that the observer chose easier ground.

Automated stations report every hour, which makes them better for storms and melt, but a single sensor can be fooled by drifting. When the two disagree, the manual course is usually the better guide to how much water the basin holds, and the station is the better guide to when it changed.

Next: comparing seasons
Source · measure/field-notes.tsx
measure/field-notes.tsx
import { Box, Measure } from '@blocks/design-system'

export default function FieldNotes() {
  return (
    <Measure as="article" size="md" aria-labelledby="field-notes-title">
      <Box as="h3" id="field-notes-title" marginTop="none">
        Reading a snow course
      </Box>
      <p>
        A snow course is a line of marked points where observers measure depth and water content by hand. The same
        points are sampled near the first of each month, so a season’s readings can be compared with decades of earlier
        ones without worrying that the observer chose easier ground.
      </p>
      <p>
        Automated stations report every hour, which makes them better for storms and melt, but a single sensor can be
        fooled by drifting. When the two disagree, the manual course is usually the better guide to how much water the
        basin holds, and the station is the better guide to when it changed.
      </p>
      <a href="#next-reading">Next: comparing seasons</a>
    </Measure>
  )
}
Field notes

Sizes

size takes a measure token: sm (26rem), md (38rem, the default) or lg (46rem). The tokens are rems rather than ch, so a line doesn’t change length when a web font replaces the fallback. On a screen narrower than the measure, Measure is simply the full width. Pass marginX="none" to align it to the start instead of centering.

size="sm"
size="md"
size="lg"
Source · measure/sizes.tsx
measure/sizes.tsx
import { Box, Measure, Stack } from '@blocks/design-system'

export default function Sizes() {
  return (
    <Stack gap="sm">
      {(['sm', 'md', 'lg'] as const).map((size) => (
        <Measure key={size} size={size} marginX="none">
          <Box padding="xs" border="default" backgroundColor="bg-subtle">
            size="{size}"
          </Box>
        </Measure>
      ))}
    </Stack>
  )
}
Measure sizes

Props

Measure props
PropTypeDefaultDescription
asElementType—The element or component to render, e.g. `as={NextLink}`.
size"sm" | "md" | "lg"mdA measure token: `sm` (26rem), `md` (38rem) or `lg` (46rem). Defaults to `"md"`.

Also accepts Box layout props, styling escape hatches, margin props and padding props, and the native attributes of the element it renders.

Accessibility

  • Short lines are easier to track from one line to the next, especially when text is enlarged.
  • Measure sets only a maximum width, so text still reflows when zoomed.