Buttons
Design
Resting | Disabled | Comment |
---|---|---|
The simple button can be used in different contexts: in the tool bar to access primary actions (Ask question), in the footer of a form or dialog to confirm and submit the inputs (OK), and within forms to access additional functionality (Browse). | ||
The caution button is used to confirm actions that are high risk. | ||
The subtle button is used where an action that is often not the focus of the page - it has a subtle design that provides a lower weight in the resting state's visual hierarchy. |
Button groups
There are two types of button group, combined and separate. Combined groups are for buttons which directly relate to each other, to the extent that they are part of one overall choice or action. Separate groups keep the individual buttons separate, as their actions are not directly related.
The default type is the Combined button group, which creates a set of related buttons in a combined style:
Separate button groups are a simple wrapper for buttons, keeping the buttons themselves separate:
Separate button groups often aren't necessary if the buttons are already contained in another element, for example within a Header actions item.
Pressed buttons
Pressed buttons can be used in combined groups to indicate interactions such as choosing filters. In most cases, only one button in the group will be pressed at a time:
Note this is not the same as the Toggle control which toggles between two named states.
Dimensions
In the majority of cases, the default button size is the right thing to use. In some cases it is necessary to override this by manually setting dimensions.
Buttons can be set to four sizes, with a minimum width for each that will scale horizontally to allow for internationalisation. While there are larger button sizes all care must be taken to craft a concise button label.
Example | Width (pixels) | Comment |
---|---|---|
31 | Used for displaying a familiar action that can be represented by a single icon. | |
80 | The most commonly used button size. | |
140 | Useful when more information is needed to convey the action. | |
200 | Useful when more information is needed to convey the action. |
Code
Example | Element | Code |
---|---|---|
Default button. |
|
|
Caution button. |
|
|
Subtle button. |
|
|
'Link buttons' are used when the design requires a link set next to a button; or for cases where the code requires a BUTTON element, but the design requires a link style. |
|
|
Icons for link buttons are placed before the text rather than afterwards. |
|
|
Buttons can include an icon. Note the icon can have additional alternate text if required; but don't set the same string for both. |
|
|
Icon-only buttons have a modifier class and wrap an instance of ace-icon. Note there must always be descriptive text available within the button, so it is included within the icon. |
|
|
Icon-only subtle button. |
|
|
Setting button to collapsible makes the text hidden on small screens. |
|
|
To set a button to disabled style use the native disabled attribute in fully quoted form. |
|
|
|
||
Sizes are set with modifier classes. |
|
|
|
||
|
||
|
||
Buttons can be grouped by adding the ace-button-group wrapper element. |
|
|
Buttons can be grouped but kept separate by adding the ace-button-group wrapper element with the additional class ace-button-group-separate . |
|
|
Pressed button groups can only have one button pressed at a time. Follow the general behaviour of radio buttons. To set a button to pressed, use the aria-pressed attribute set to true or false . |
|