2013-10-31 22:03:40 +00:00
title: ButtonWidget
created: 201310241419
2014-06-17 06:54:10 +00:00
modified: 201406170837
2014-09-10 23:06:19 +00:00
tags: Widgets
caption: button
2013-10-31 22:03:40 +00:00
! Introduction
2014-04-17 11:52:38 +00:00
The button widget displays an HTML `<button>` element that can perform a combination of optional actions when clicked:
2013-10-31 22:03:40 +00:00
2014-02-22 16:13:16 +00:00
* Navigate to a specified tiddler
2014-09-11 14:52:47 +00:00
* Dispatch a user defined [[widget message|Messages]]
2013-10-31 22:03:40 +00:00
* Trigger a user defined [[popup|PopupMechanism]]
* Assign new text to a specified tiddler
! Content and Attributes
The content of the `<$button>` widget is displayed within the button.
|!Attribute |!Description |
2014-02-22 16:13:16 +00:00
|to |The title of the tiddler to navigate to |
2014-09-11 14:52:47 +00:00
|message |The name of the [[widget message|Messages]] to send when the button is clicked |
2013-10-31 22:03:40 +00:00
|param |The optional parameter to the message |
2014-03-15 17:02:13 +00:00
|set |A TextReference to which a new value will be assigned |
|setTo |The new value to assign to the TextReference identified in the `set` attribute |
2013-10-31 22:03:40 +00:00
|popup |Title of a state tiddler for a popup that is toggled when the button is clicked |
2014-06-17 06:54:10 +00:00
|aria-label |Optional [[Accessibility]] label |
2014-06-17 09:49:13 +00:00
|title |Optional tooltip |
2013-10-31 22:03:40 +00:00
|class |An optional CSS class name to be assigned to the HTML element |
|style |An optional CSS style attribute to be assigned to the HTML element |
|selectedClass |An 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` |
2013-11-04 09:59:26 +00:00
|default |Default value if `set` tiddler is missing for testing against `setTo` to determine `selectedClass` |