Wijmo UI for the Web
Ribbon Buttons
Show AllShow All
Hide AllHide All

There are several types of buttons that you can use in the ribbon.

Big Buttons

Big ribbon buttons are created using button <button> markup. There are three components of a button:

The markup for a big save button inside a group looks like this.

Sample markup for creating a big button

Rows of Smaller Buttons

Rows of smaller ribbon buttons are created using span <span> markup with the class specified as wijmo-wijribbon-list. The span keeps together in one row all of the buttons that you specify inside it. The buttons are created using <button> markup. You can specify the class for each small button in the row as one of the following to specify icons included in the CSS file referenced in the <head> of your page. 

Note: There are two ways to use <button> markup. One is icon only, for example, a Cut button where the red X is universally understood. Another is icon and text, for example, a Find and Replace button.

The markup for two rows of small buttons inside a group looks like this, using a <span> element with the class set to wijmo-wijribbon-list for each row of small buttons, and the <button> elements for the row nested in it.

Note that if we also included a big button in the same group, as it is in the Quick Start, the first two <span> elements would break to separate rows next to the big button. In this example though, with the width of the group set to 200px in the <style>, and without a big button, the first two <span> elements appear in the top row, and the third <span> element appears on the bottom row.

Sample markup for creating rows of small buttons

CheckBox Buttons 

Rows of buttons created using input <input> markup with the type attribute set to "checkbox" creates slightly smaller buttons than those created using <button> markup. Another difference, besides the size, is that checkbox buttons stay in their clicked (or "checked") state until they are toggled off. This is useful for formatting buttons like Bold or Italic, where you can toggle one or more of the buttons at the same time.

Like the rows of smaller buttons, we start with a <span> element that has the class set to wijmo-wijribbon-list.

Each <input> element has an id attribute that matches a <label> element's for attribute. The <label> element specifies the class to use (see the list of icons in the rows of smaller buttons above for valid classes) as well as the title attribute, which provides tooltip text for the button. The markup for a row of checkbox buttons looks like this.

Sample markup for creating the smallest buttons from checkboxes

Radio Buttons

Rows of buttons created using input <input> markup with the type attribute set to "radio" creates slightly smaller buttons than those created using <button> markup. Another difference, besides the size, is that the user can only select one of radio buttons in the list. This is useful for formatting buttons like JustifyLeft, JustifyCenter, and JustifyRight, where you only want to allow one value at a time.

Like the rows of smaller buttons, we start with a <span> element that has the class set to wijmo-wijribbon-list.

Each <input> element has an id attribute that matches a <label> element's for attribute. The <label> element specifies the class to use (see the list of icons in the rows of smaller buttons above for valid classes) as well as the title attribute, which provides tooltip text for the button. The markup for a row of the smallest buttons looks like this.

Sample markup for creating the smallest buttons from radio buttons

Drop Down Buttons

Drop-down buttons are created using <div> markup with the class attribute set to wijmo-wijribbon-dropdownbutton. Nest a <button> element and an unordered list <ul> inside the main drop-down button <div> to create the button text and the drop-down items for the list. Each line item <li> contains an <input> element with the type attribute set to "radio" and a <label> element with the text to use. The markup for two drop-down buttons inside a group looks like this.

Sample markup for creating drop down buttons

Split Buttons

Split buttons are created using a main <div> element with the class attribute set to wijmo-wijribbon-splitbutton. Nest two <button> elements in the main <div> to create both halves of the split button. Also inside the main <div>, nest an unordered list, <ul>, to add the sub-items for the drop-down button on the right half. The markup for a split button inside a group looks like this.

Sample markup for creating a split button

See Also

Reference

 
Support Options