Primary Action Button

Primary action - create a new address book entry.

When to Use

Use a Primary Action Button whenever there is a primary action for a certain page of your application or for the whole application, which is executed frequently. Typical primary actions are "Create New", "Edit,", "Save" or "Send".

Additionally you can opt to define two secondary primary actions that are placed left and right to the main primary button.

Call, message and write an email as primary actions

If there is no primary action, you may opt to use the Primary Action Button as a shortcut to navigate back to the application's main page instead of omitting it completely. Do that in any of the following cases:

  • navigating back to the main page is a frequent action in your application
  • you use Primary Action buttons on some pages and would like to keep the layout consistent across pages
  • drawers are frequently used and the space occupied by the button is not urgently needed for the content

If the primary action is clearly associated with a specific element on the user interface, place controls within the content instead.

How to Use

  • Provide a clear icon for the Primary Action Button since it has no text label
  • If the Primary Action Button changes its action within a page (for example switching to "save" when editing), change its icon as well
  • If you use the Primary Action Button as a shortcut for going to the main page, use the "go-home" icon from the actions category for it

Desktop-Specific

If your application is using column-based navigation:

  • If there is a global Primary Action, associate it with the first column
  • If there is a Primary action for the context of a specific column, associated with the respective page
Primary Action Buttons are placed in a toolbar toolbar

Primary Action Buttons are placed in a toolbar toolbar

Code

Kirigami

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
...
import org.kde.kirigami 2.9 as Kirigami
...

Kirigami.ApplicationWindow {
    ...
    pageStack.initialPage: Kirigami.ScrollablePage {
        ...
        actions {
            left: Kirigami.Action {
                iconName: "mail-message"
                text: i18n("&Write mail")
            }
            main: Kirigami.Action {
                iconName: "call-start"
                text: i18n("&Make call")
            }
            right: Kirigami.Action {
                iconName: "kmouth-phrase-new"
                text: i18n("&Write SMS")
            }
        }
    }
    ...
}