IFFDAYIFFDAYDesign
Controls

Button

Four looks, two sizes, a pill shape and the round icon-button.

import { Button } from '@iffday/ui';

Looks

Button wraps Base UI’s button; className decides how it looks. .button is the default: white with an outline. primary is the one main action on a page, black with white text, reversed in dark mode. soft is grey and suits toolbars. neutral stays transparent until hovered, for Cancel and other secondary actions.

Sizes and shape

The default is 38px tall and small is 31px. The site uses small more often than the default: buttons in list rows, cards and sidebars are small. pill rounds the ends fully and also takes the grey of the Pill label; the follow, edit profile and invitation buttons on profile pages use it.

Icon only

.icon-button is a 34px circle in the secondary text grey; with active it turns brand red, as the Watchlist heart does. An icon-only button always needs an aria-label. A text button can carry an icon too: put it before the text, and the button leaves 7px between them.

States

selected has the colors of primary and marks a pressed filter; set aria-pressed with it. A button that is saving gets disabled and aria-busy: disabled buttons drop to 45% opacity, and a busy one shows the progress cursor.

Usage

  • Button defaults to type="submit". Outside a form, or for any button that does not submit, write type="button".
  • Web code never writes a native <button>: tests/ui-boundary.test.ts fails on one.
  • Navigation is a link, never a button. To make a link look like a button, give the Link className="button".
  • The stylesheet also has accent (brand red) and full (full width); no page uses them yet.

Props