StippleUI.Checkboxes.checkbox - Function
checkbox(label::Union{String,Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
The checkbox
component is another basic element for user input. You can use this to supply a way for the user to toggle an option.
Examples
Model
julia> @vars CheckboxModel begin
valone::R{Bool} = true
end
View
julia> checkbox(label = "Apples", fieldname = :valone, dense = true, size = "xl")
Arguments
- Behaviour
name::String
- Used to specify the name of the control; Useful if dealing with forms submitted directly to a URLindeterminatevalue::Union{String, Float64, Int, Bool}
- What model value should be considered as 'indeterminate'?toggleorder::String
- Determines toggle order of the two states ('t' stands for state of true, 'f' for state of false); If 'toggle-indeterminate' is true, then the order is: indet -> first state -> second state -> indet (and repeat), otherwise: indet -> first state -> second state -> first state -> second state -> ... ex."tf"
"ft"
toggleindeterminate::Bool
- When user clicks/taps on the component, should we toggle through the indeterminate state too?keepcolor::Bool
- Should the color (if specified any) be kept when the component is unticked/ off?
- General
tabindex::Union{Int, String}
- Tabindex HTML attribute value
- Label
label::Union{String,Symbol}
- Label to display along the componentleftlabel::Bool
- Label (if any specified) should be displayed on the left side of the component
- Model
fieldname::Symbol
- Model of the componentval::Union{String, Float64, Int, Bool}
- Works when model ('value') is Array. It tells the component which value should add/remove when ticked/untickedtruevalue::Union{Int, Float64, String}
- What model value should be considered as checked/ticked/on?falsevalue::Union{Int, Float64, String}
- What model value should be considered as unchecked/unticked/off?
- State
disable::Bool
- Put component in disabled mode
- Style
size::String
- Size in CSS units, including unit name or standard size name (xs|sm|md|lg|xl) ex."16px"
"2rem"
"xs"
"md"
color::String
- Color name for component from the Color Palette eg."primary"
"teal-10"
dark::Bool
- Notify the component that the background is a dark colordense::Bool
- Dense mode; occupies less space