This page is part of a static HTML representation of the TiddlyWiki at https://tiddlywiki.com/

ButtonWidget/Example/SelectedState

24th July 2026 at 11:58pm

This example combines four attributes so a row of buttons can show which colour is active:

  • set and setTo write the chosen colour to a state tiddler
  • selectedClass marks the button whose setTo matches the current value of set
  • default gives the value to compare against while the set tiddler does not yet exist

Because default is red, the Red button starts out selected. Click another colour to move the selection.

titleOutput

Selected colour: red