IFFDAYIFFDAYDesign
Controls

ToggleButton

A button with a pressed and an unpressed state, for marks like Watchlist and Like.

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

Example

ToggleButton only handles pressed and unpressed: pressed, it carries data-pressed and a screen reader announces it as pressed. className decides the look. The Watched, Watchlist and Add to plan buttons under a film page’s poster use release-toggle: pressed, the text turns brand red on a 10% red ground.

Usage

  • Change the words with the state (Watchlist, On watchlist), so color is not the only signal.
  • For a toggle that needs a signed-in reader, check the session in onPressedChange before switching.
  • The Like button is one too: see LikeButton on ReviewCard.

Props

A pressable two-state button (record.club's Listened / Rotation / Queue).

PropTypeDefault
children*ReactNode
className''

Other props go to ComponentProps<typeof Toggle> (see the Base UI documentation).