Button¶
-
/libs/granite/ui/components/coral/foundation/button Button is a component to represent a HTML button (<button>).
It has the following content structure:
-
granite:Button
- granite:commonAttrs
- granite:renderCondition
-
typestring
- button
- button
- submit
- reset
The type attribute.
- disabledboolean
trueto disable the button;falseotherwise.
-
autocompletestring
- off
- on
- off
The autocomplete attribute.
- formIdstring
The form attribute.
- textstring
- i18n
The body text of the element.
- text_commentI18nstring
I18n comment for the body text of the element.
- hideTextboolean
Visually hide the text. It is RECOMMENDED that every button has a text for a11y purpose. Use this property to hide it visually, while still making it available for a11y.
- activeboolean
trueto make this button in active state;falseotherwise.
- iconstring
The icon name. e.g. “search”.
-
iconSizestring
- S
- XS
- S
- M
- L
The size of the icon.
-
sizestring
- M
- M
- L
The size of the button.
- blockboolean
trueto render the button as a block element;falseotherwise.
-
variantstring
- primary
- warning
- quiet
- minimal
- actionBar
The variant of the button.
- commandstring
Command used as a shortcut for the action. It accepts single keys, sequenques and key modifiers. Command will override actionConfigName.
When
ctrlorcmdis used, it will be normalized based on the client’s OS.Grammar (ABNF)
command ::= key / sequence / modifier-cmd key ::= valid-keyboard-key sequence ::= key 1*("-" key) modifier-cmd ::= modifier *("+" modifier) "+" key modifier ::= "ctrl" / "alt" / "meta" / "shift" / "cmd"e.g.
d,m,c,l-c,c-r,ctrl+c,alt+1,meta+t,shift+a,cmd+i
- actionConfigNamestring
The actionConfigName directs to the central configuration for a keyboard shortcut. An actionConfigName will set following attributes of this action to the global standard definitions: command, icon and text. Example value: granite/ui/shell/actions/edit The example will set for this action the attributes command, text and icon to the edit use case to the global default values under /conf/settings/granite/ui/shell/actions/edit. The global defaults could be changed under /conf/settings/granite/ui/shell/actions to other default values.
- trackingFeaturestring
The name of the feature that the interaction takes place.
See foundation-tracking.
- trackingElementstring
The element this component represent for the purpose of tracking. By default the value of
textorgranite:titleis used.See foundation-tracking.
-
typestring
-
granite:Button