Skip to content

Primitives

The shared atoms — Mark, SectionTag, Rule, Badge, Spinner, Frame, Slider and Tooltip. Every other component is built from these.

Live — this one is real

Mark — the diamond

SectionTag

01 — Foundation

Rule

Interlude

Badge

LiveDraftQueuedArchived

Spinner

Frame

Fig. 01

Slider

Tooltip

Copied to clipboard

Usage

import { useState } from "react";
import {
  SectionTag,
  Rule,
  Badge,
  Spinner,
  Frame,
  Slider,
  Tooltip,
} from "mizu-ui";

export function Header() {
  const [v, setV] = useState(40);
  return (
    <>
      <SectionTag tone="muted">01 — Foundation</SectionTag>
      <Rule label="Interlude" />
      <Badge tone="accent">Live</Badge>
      <Spinner size={12} />
      <Frame label="Fig. 01">
        <p>Framed content</p>
      </Frame>
      <Slider label="Density" value={v} min={0} max={100} onChange={setV} />
      <Tooltip label="Help">
        <button>Focus me</button>
      </Tooltip>
    </>
  );
}

Source & setup

Import mizu-ui/styles.css once. Fonts are optional via mizu-ui/fonts.css. Override --mizu-* tokens or use className for local styling. Uses native React and CSS; install the package peers for root imports.

Inspect ui/Mark.tsx

Source is included in the npm package under src/ui/Mark.tsx.

Open full source ↗

Props

PropTypeDefaultDescription
Marksize, tone—The diamond glyph. Tones: accent, paper, muted, line.
SectionTagtone, diamond—Mono uppercase label with optional diamond marker.
Rulelabel, node, tone—Hairline divider with optional centered node and label.
Badgetone, diamond—Status chip. Tones: paper, muted, accent, line.
Spinnersize, tone, label—Rotating diamond loader with role=status.
Framelabel, tone—Crop-mark frame for media with optional caption plate.
Sliderlabel, value, min, max, step, onChange—Diamond-thumb range control.
Tooltiplabel, side—Linked tooltip on hover/focus, dismissible with Escape.

Accessibility

Mark is aria-hidden (decorative). Spinner exposes role=status with a label. Tooltip appears on :focus-within as well as hover. Slider is a labelled native input.

Motion

Spinner rotates on a 900ms linear loop. Tooltip fades and rises on hover/focus.

Works alongside