815N/A var toggleButton = new Y.ToggleButton({
815N/A var button = new Y.Plugin.Button.createNode("#testButton", {
815N/A var buttonGroup = new Y.ButtonGroup({
815N/A <li><a href="#cssbutton">`cssbutton`</a> - Includes various `yui3-button` styles to provide a normalized CSS base for buttons.</li>
815N/A <li><a href="#button">`button`</a> - Exports the `Y.Button` & `Y.ToggleButton` widgets.</li>
815N/A <li><a href="#buttongroup">`button-group`</a> - Exports the `Y.ButtonGroup` widget.</li>
815N/A <li><a href="#buttonplugin">`button-plugin`</a> - Exports the `Y.Plugin.Button.createNode` factory.</li>
815N/A <li>`button-core` - Exports `Y.ButtonCore`, a base used by all other Button component modules.</li>
815N/A <li>`use('button-plugin')` if you only need to enhance a DOM node with button functionality</li>
815N/A <p>YUI's Button component was designed with the idea in mind that sometimes you may only want button styles, without the need for any JavaScript functionality. Instead of `use('button', ...)`, you can just include the `cssbutton` module. This can be done dynamically with `use('cssbutton')`, or statically with a `link` tag.</p>
815N/A<link rel="stylesheet" href="http://yui.yahooapis.com/{{yuiVersion}}/build/cssbutton/cssbutton.css">
815N/A <p>These styles are designed to progressively enhance. In legacy browsers, you'll get styles that appear as basic buttons, and in new browsers you'll get buttons using modern styles. cssbutton is intended to provide a base and be overridable with custom styles. Such as `background-color`.</p>
815N/A <p>A feature of cssbutton is that it uses transparent gradients to create a colored effect. So if you would like a button that has a light to dark red gradient, you do not need to specify all the styles for proper cross-browser gradients, you only need to specify a single `background-color` style to your buttons.</p>
815N/A <p>This module serves as the foundation for all Button component JavaScript modules and exports `Y.ButtonCore`. While you can use it stand-alone if you like, it is typically a foundational building block for all other Button classes.</p>
815N/A <p>This module exports the `Y.Plugin.Node.createNode` factory, which simplifies the process of plugging nodes with `Y.ButtonCore`.</p>
815N/A <p>`Y.Button` combines `Y.ButtonCore` with `Y.Widget`, to give you basic button functionality, but with the benefits of having a <a href='/yui/docs/widget/'>Widget</a> instance. This can be used as a building block for different types of advanced buttons.</p>
815N/A <h4>Y.ToggleButton</h4>
815N/A <p>`Y.ToggleButton` does everything that `Y.Button` does (by extending it), and adds the concept of a selected state, which is referred to as either 'pressed' or 'checked', depending on the `type` attribute of the instance. This distinction is made for proper ARIA support.</p>
815N/A <p>So what do you get from `Y.Button`/`Y.ToggleButton` over just creating or plugging a `<button>` node?</p>
815N/A <li><strong>Accessibility</strong> - Your buttons automatically create and manage their own ARIA <a href='http://www.w3.org/TR/wai-aria/states_and_properties'>states</a> & <a href='http://www.w3.org/TR/wai-aria/roles'>roles</a>. This includes states like `aria-pressed` & `aria-checked`, also appropriate roles like `button`, `checked`, `radio`, etc...</li>
815N/A <li><strong>State management</strong> - Instances automatically apply classes, such as `yui3-button-selected` and `yui3-button-disabled` which are useful for styling purposes. Also, `Y.ToggleButton` will fire a 'pressedChange' or 'checkedChange' event (depending on `type`) when the button's state changes from selected to unselected, or vice-versa. This event eliminates the typical case of listening for all 'click' events and then verifying a state changed actually did occur.</li>
815N/A <p>`Y.ButtonGroup` is a constructor that is used to generate widgets containing a group of buttons. To avoid widgets inside of widgets, this class is built on top of `Y.ButtonCore`, not `Y.Button`</p>
815N/A<p><strong>Note</strong>: This is not an exhaustive list. See the API documentation for a complete listing.</p>
815N/A<h4>Y.ButtonCore</h4>
Sets the button's disabled state to true/false
<p>Inherited from `Y.ButtonCore`</p>
<h4>Y.Button</h4>
<p>Identical to `Y.ButtonCore`</p>
<h4>Y.ToggleButton</h4>
<p>In addition to the inherited `Y.Button` attributes...</p>
<p>The difference is that a 'toggle' button will use <a href='http://www.w3.org/TR/wai-aria/states_and_properties#aria-pressed'>aria-pressed</a>, and a 'checkbox' button will use <a href='http://www.w3.org/TR/wai-aria/states_and_properties#aria-checked'>aria-checked</a>.</p> </td>
<h4>Y.ButtonGroup</h4>
<p>In addition to the inherited `Y.ButtonCore` attributes...</p>
<h4>Y.ButtonCore</h4>
<p>Inherited from `Y.ButtonCore`</p>
<h4>Y.Button</h4>
<p>Identical to `Y.ButtonCore`</p>
<h4>Y.ToggleButton</h4>
<p>In addition to the inherited `Y.Button` events...</p>
Fires for toggle buttons to notify the subscriber the selected state is about to be, or has been updated.
Identical to `"pressedChange"`, but only applicable for buttons with a configuration attribute `"type: 'checkbox'"`.
<h4>Y.ButtonGroup</h4>
<p>In addition to the inherited `Y.ButtonCore` events...</p>