TouchBarButton Type
⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ❌
Create a button in the touch bar for native macOS applicationsProcess: Main This class is not exported from the 'electron' module. It is only available as a return value of other methods in the Electron API.
Constructors
| Constructor |
Description
|
Full Usage:
TouchBarButton(?label, ?accessibilityLabel, ?backgroundColor, ?icon, ?iconPosition, ?click, ?enabled)
Parameters:
string
-
Button text.
?accessibilityLabel : string
-
A short description of the button for use by screenreaders like VoiceOver.
?backgroundColor : string
-
Button background color in hex format, i.e #ABCDEF.
?icon : U2<NativeImage, string>
-
Button icon.
?iconPosition : IconPosition
-
Can be left, right or overlay. Defaults to overlay.
?click : unit -> unit
-
Function to call when the button is clicked.
?enabled : bool
-
Whether the button is in an enabled state. Default is true.
Returns: TouchBarButton
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.accessibilityLabel
|
A string representing the description of the button to be read by a screen reader. Will only be read by screen readers if no label is set. |
Full Usage:
this.backgroundColor
|
A string hex code representing the button's current background color. Changing this value immediately updates the button in the touch bar. |
Full Usage:
this.enabled
|
A boolean representing whether the button is in an enabled state. |
Full Usage:
this.icon
|
A NativeImage representing the button's current icon. Changing this value immediately updates the button in the touch bar. |
Full Usage:
this.iconPosition
|
A string - Can be left, right or overlay. Defaults to overlay. |
Full Usage:
this.label
|
A string representing the button's current text. Changing this value immediately updates the button in the touch bar. |
fable-electron-docs-api