Skip to content
AtlasOSFramework API
Browse the docs

PrimaryButton

An AtlasButton preset as a filled accent button, for the main action.

PrimaryButton is AtlasButton with prominent: true: an accentStrong button with accentStrongText text (white in Light, near-black in Dark) and 4 px corners, for the one main action of a view. The properties, states and enums are AtlasButton's; see its page. Use SecondaryButton for the other actions and TextButton for a link-style action.

PrimaryButton is a Qt Quick Templates AbstractButton (Qt documentation); its inherited properties (text, icon, checkable, checked, clicked) work as usual.

Example

PrimaryButton { text: qsTr("Save"); onClicked: save() }

Properties

Name Type Default Description
accent color (read-only) AtlasStyle.accent The accent colour, for custom content.
busy bool false Something is in progress: shows a spinner in place of the symbol and takes no presses.
prominent bool true The preset: the button is drawn prominent. Ignored when variant is not Default.
symbol int (a Symbols.<Name> value, see Symbols) 0 A Material Symbol drawn instead of icon.name; 0 for none.
textTint color (read-only) the theme's text colour The normal text colour, for custom content.
variant int (AtlasButton.Variant) AtlasButton.Default The look. A variant other than Default wins over prominent.

Enums

Variant

Value Description
PrimaryButton.Default Control fill and a hairline border; prominent decides the look.
PrimaryButton.Prominent Strong accent fill: the one main action of a view.
PrimaryButton.Destructive Error-coloured text and border on a faint error fill.
PrimaryButton.Ghost No fill and no border until hover.

Note

New code can use AtlasButton with variant directly; PrimaryButton, SecondaryButton and TextButton stay supported.