Signpost

Wooden signs on a picture, each a toggle: boards on a pole, arrows to either side, an effect on the chosen one and a sheen on the rest.

A fork in a road between a sunny castle and a stormy one.

Features

  • Signs placed by percent on any picture, so they stay on the painted post at every width.
  • Three shapes: a framed board with brass nails, and arrows pointing left or right from a pole.
  • The chosen sign stands proud and draws its own effect; the others pass a sheen now and then, so they read as buttons.
  • A hidden sign fades and steps aside; in a container under 640px the signs leave the picture for a two-column board.

Use it for

  • Choosing a section of a page with a picture that means something.
  • Game menus, maps, crossroads.

On this site

Installation

  1. Get runets.
    git clone https://github.com/ziyam-khan/runets
  2. Copy these files into your project, keeping their folders.
  3. Install what they use.
    pnpm add react
  4. Load the styles once. Bring your own base tokens, or use runets’ default theme.
    import 'runets/styles/theme.css'
    import 'runets/styles/kit.css'

API

PropTypeWhat it does
imageimg attributesThe picture; its width and height set its shape.
signs{ id, label, count?, shape, at, effect?, hidden? }[]at is [x, y] in percent: the pole for boards, the base for arrows.
value / onValueChangestringThe chosen sign.
pole[x, top, bottom]A pole in percent that carries the boards.
idlebooleanThe occasional sheen; off when motion is off.
labelstringThe name of the group of signs.

Accessibility

Source

The code is in src/kit/signpost.tsx in runets, MIT licensed.