Play Pause Toggle

UI ElementsData BindingIn a set
Live
Tap to switch

Play and pause. The triangle squashes flat and two bars spring up.

Get the file

This one comes with the Toggle Icon Set: all 10 icons, the .riv and the .rev of each.

The whole set

.rev + .riv

All 10 files in one zip. Open the .rev in the Rive editor and change anything, or use the .riv as it is.

Use it on your site

import { useRive } from '@rive-app/react-canvas';

export function TogglePlayPause() {
  const { rive, RiveComponent } = useRive({
    src: '/toggle-play.riv',
    artboard: 'Toggle Play Pause',
    stateMachines: 'State Machine',
    autoplay: true,
    autoBind: true,
  });

  // every input on this page is a view model property
  const vm = rive?.viewModelInstance;
  if (vm) vm.color('onColor').value = 0xFF58B25D;

  return <RiveComponent style={{ width: '100%', height: 400 }} />;
}

Inputs: on, onColor, offColor, outline. All on the TogglePlay view model.

Also in the Toggle Icon Set

More ui elements

See all →