1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-09 03:19:56 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets/ButtonWidget.tid

40 lines
2.0 KiB
Plaintext
Raw Normal View History

2014-09-10 23:06:19 +00:00
caption: button
created: 20131024141900000
2015-06-19 11:12:41 +00:00
modified: 20150619111219516
tags: Widgets
title: ButtonWidget
type: text/vnd.tiddlywiki
! 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:
* 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|Messages]]
** Trigger a user defined [[popup|PopupMechanism]]
** 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.
|!Attribute |!Description |
|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 |
|param |The optional parameter to the message |
|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 |
|popup |Title of a state tiddler for a popup that is toggled when the button is clicked |
|aria-label |Optional [[Accessibility]] label |
2014-10-05 15:33:05 +00:00
|tooltip |Optional tooltip |
2014-12-16 14:36:20 +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` |
2015-06-19 11:12:41 +00:00
|tag |An optional html tag to use instead of the default "button" |
2014-12-16 14:36:20 +00:00
|default |Default value if `set` tiddler is missing for testing against `setTo` to determine `selectedClass` |
2015-04-27 12:25:43 +00:00
''Tip:'' Set ''class'' to `tc-btn-invisible tc-tiddlylink` to have a button look like an internal link.