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

ButtonWidget

127.0.0.117 décembre 2014 à 21h12

Introduction

The button widget displays an HTML <button> element that can perform a combination of optional actions when clicked:

  • Executing any ActionWidgets that are immediate children of the button widget
  • Execute any integrated actions:
    • Navigate to a specified tiddler
    • Dispatch a user defined widget message
    • Trigger a user defined popup
    • Assign new text to a specified tiddler

The integrated actions are provided as a shortcut for invoking common actions. The same functionality is available via ActionWidgets, with the exception of the support for highlighting selected popups.

Content and Attributes

The content of the <$button> widget is displayed within the button.

AttributeDescription
toThe title of the tiddler to navigate to
messageThe name of the widget message to send when the button is clicked
paramThe optional parameter to the message
setA TextReference to which a new value will be assigned
setToThe new value to assign to the TextReference identified in the set attribute
popupTitle of a state tiddler for a popup that is toggled when the button is clicked
aria-labelOptional Accessibility label
tooltipOptional tooltip
classAn optional CSS class name to be assigned to the HTML element
styleAn optional CSS style attribute to be assigned to the HTML element
selectedClassAn optional additional CSS class to be assigned if the popup is triggered or the tiddler specified in set already has the value specified in setTo
defaultDefault value if set tiddler is missing for testing against setTo to determine selectedClass

Tip: Set class to tc-btn-invisible tc-tiddlylink to have a button look like an internal link.