Sub topic 6
Button states: default, hover, pressed, disabled
This chapter assumes you can insert a button, format it in the Format pane, and assign an action to it. Those steps are covered in the earlier button chapters. Here you will style how a button looks as the user interacts with it.
The four states
A Power BI button has four states. Each state keeps its own formatting.
| State | When it applies |
|---|---|
| Default | The button at rest, with no interaction. |
| On hover | The pointer is over the button. |
| On press | The user is clicking the button. |
| Disabled | The button's action cannot run. |
Visual feedback tells users that an element is clickable and that their click registered. Without it, a flat rectangle looks like a label.
Styling each state
- Select the button.
- Open the Format pane and expand Style.
- Use the Apply settings to dropdown and pick a state. It starts on Default.
- Change the Shape, Text, Icon, Fill, Border, Shadow, or Glow settings. Each setting has its own toggle, and the changes apply only to the state you picked.
A common recipe:
- Default: a mid-tone fill with white text.
- On hover: a slightly darker fill, so the button reacts as the pointer approaches.
- On press: a darker fill again, or a thicker border, to confirm the click.
- Disabled: a gray fill with gray text and no shadow, so the button looks inactive.
Keep the layout constant across states. Changing font size or border width can make the button appear to jump. Change colors, and at most a border or shadow.
When a button is disabled
Power BI applies the Disabled state when a button's action cannot be carried out. A Back button on a page with no history is one example. A button whose action points to a destination that doesn't exist, such as a bookmark that was deleted, is another. You can use the state deliberately. A Back button with a visibly grayed Disabled style tells users there is nowhere to go back to.
Seeing the states while you work
States are easy to get wrong because you can't see them while editing. In Desktop, a button's action runs only on Ctrl+click, so the press behavior is hard to judge there. To check hover and pressed styling, publish the report and test it in the Power BI service, or use reading view. Then try each button as a user would.
Common mistakes
- Styling only Default. The button then shows no feedback when used.
- Hover and pressed that look identical to Default. Users can't tell whether the click registered. Keep a visible difference between states.
- Low contrast in the Disabled state. Gray text on a gray fill can become unreadable. A disabled button should look inactive but still be legible.
- Relying on color alone. Some users can't see color differences. Pair a color change with a border or icon change for important buttons.
Exercise
You styled a Reset button's fill color on the Default state, but users say it gives no feedback when they click it. What did you probably miss, and how do you fix it?
Show answer
You did not style the On press state (and probably not On hover). Select the button, open Format > Style, choose On press in the "Apply settings to" dropdown, and turn on and change the Fill (for example, a darker color). Repeat for On hover, then test in the Power BI service or reading view.