Ui.Button
Buttons.
See the styling information.
val v : ?class':Jstr.t -> ?active:bool Note.signal -> ?enabled:bool Note.signal -> ?tip:Jstr.t Note.signal -> Brr.El.t list Note.signal -> 'a -> 'a t
v ~class' ~active ~enabled ~tip label action
is a button with:
label
the button's label.action
the value reported when the button is actuated.tip
a tooltip for the button.enabled
indicates if the button can be interacted with. Defaults to S.Bool.true'
.active
indicates that the button is being interacted with programmatically (e.g. via a shortcut)class'
is added to the underlying element's classesval action : 'a t -> 'a Note.event
action b
is an event that occurs when the button is actuated.
val enabled : 'a t -> bool Note.signal
enabled b
is a signal that is true
iff the button is enabled.
val active : 'a t -> bool Note.signal
active b
is a signal that is true
iff the button is being interacted with. FIXME. For now this doesn't change on mouse activation.
val file_selector : ?class':Jstr.t -> ?active:bool Note.signal -> ?enabled:bool Note.signal -> ?tip:Jstr.t Note.signal ->
?exts:string list -> Brr.El.t list Note.signal -> Brr.File.t t
file_selector ~exts cs
is a button which, whenever clicked, allows to select a file on the host's file system. exts
is the caseless list of file extensions (including the dot) that can be selected; all file can be selected if this is the empty list (default).
The resulting element as an additional ui-file-selector
class. See Styling.
val files_selector : ?class':Jstr.t -> ?active:bool Note.signal -> ?enabled:bool Note.signal -> ?tip:Jstr.t Note.signal ->
?exts:string list -> Brr.El.t list Note.signal -> Brr.File.t list t
files_selector
is like file_selector
but allows multiple files to be selected.
The element returned by el
makes use of the following CSS classes:
ui-button
always.ui-file-selector
always iff created via file_selector
or files_selector
ui-active
whenever active
is true
.ui-disabled
whenever enabled
is false
.