Stipple has a component called btn which is a button with a few extra useful features. For instance, it comes in two shapes: rectangle (default) and round. It also has the material ripple effect baked in (which can be disabled).
The button component also comes with a spinner or loading effect. You would use this for times when app execution may cause a delay and you want to give the user some feedback about that delay. When used, the button will display a spinning animation as soon as the user clicks the button.
When not disabled or spinning, btn emits a @click event, as soon as it is clicked or tapped.
Examples
julia> btn("Move Left", color = "primary", icon = "mail", @click("press_btn = true"))
julia> btn("Go to Hello World", color = "red", type = "a", href = "hello", icon = "map", iconright = "send")
julia> btn("Connect to server!", color="green", textcolor="black", @click("btnConnect=!btnConnect"), [
tooltip(contentclass="bg-indigo", contentstyle="font-size: 16px",
style="offset: 10px 10px", "Ports bounded to sockets!")]
)
Arguments
- Behavior
loading::Bool- Put button into loading state (displays aspinner– can be overridden by using a 'loading' slot)percentage::Union{Int, Float64}- Percentage (0.0 < x < 100.0); To be used along 'loading' prop; Display a progress bar on the background ex.23darkpercentage::Bool- Progress bar on the background should have dark color; To be used along with 'percentage' and 'loading' props
- Content
label::Union{String, Symbol, Nothing}- The text that will be shown on the button ex.Button Labelicon::String- Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix; If 'none' (String) is used as value then no icon is rendered (but screen real estate will still be used for it) ex.mapion-addimg:https://cdn.quasar.dev/logo/svg/quasar-logo.svgimg:path/to/some_image.pngiconright::String- Icon name following Quasar convention; Make sure you have the icon library installed unless you are using 'img:' prefix; If 'none' (String) is used as value then no icon is rendered (but screen real estate will still be used for it) ex.mapion-addimg:https://cdn.quasar.dev/logo/svg/quasar-logo.svgimg:path/to/some_image.pngnocaps::Bool- Avoid turning label text into caps (which happens by default)nowrap::Bool- Avoid label text wrappingalign::String- Label or content alignment default.centeraccepted values.leftrightcenteraroundbetweenevenlystack::Bool- Stack icon and label vertically instead of on same line (like it is by default)stretch::Bool- When used on flexbox parent, button will stretch to parent's height
- General
type::String- 1) Define the button native type attribute (submit, reset, button) or 2) render component with <a> tag so you can access events even if disable or 3) Use 'href' prop and specify 'type' as a media tag default.buttonex.asubmitresetbuttonimage/pnghref="https://some-site.net" target="_blank"tabindex::Union{Int, String}- Tabindex HTML attribute value
- Navigation
href::String- Native <a> link href attribute; Has priority over the 'to' and 'replace' props ex.https://quasar.devhref="https://quasar.dev" target="_blank"target::String- Native <a> link target attribute; Use it only with 'to' or 'href' props ex._blank_self_parent_top
- State
loading::Bool- Put button into loading state (displays aspinner– can be overridden by using a 'loading' slot)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.16px2remxsmdripple::Union{Bool, Dict}- Configure material ripple (disable it by setting it to 'false' or supply a config object) default.trueex.false{ "early" => true, "center" => true, "color" => "teal", "keyCodes" => [] }outline::Bool- Useoutlinedesignflat::Bool- Useflatdesignunelevated::Bool- Remove shadowrounded::Bool- Applies a more prominent border-radius for a squared shape buttonpush::Bool- Use 'push' designglossy::Bool- Applies a glossy effectfab::Bool- Makes button size and shape to fit a Floating Action Buttonfabmini::Bool- Makes button size and shape to fit a small Floating Action Buttonpadding::String- Apply custom padding (vertical horizontal); Size in CSS units, including unit name or standard size name (none|xs|sm|md|lg|xl); Also removes the min width and height when setcolor::String- Color name for component from the Color Palette eg.primaryteal-10textcolor::String- Overrides text color (if needed); Color name from the Color Palette eg.primaryteal-10dense::Bool- Dense mode; occupies less spaceround::Bool- Makes a circle shaped button
::: warning Missing docstring.
Missing docstring for Btn. Check Documenter's build log for details.
:::
You can conveniently group btn and btndropdown using btngroup. Be sure to check those component’s respective pages to see their props and methods.
Arguments
- Content
spread::Bool- Spread horizontally to all available spacestretch::Bool- When used on flexbox parent, buttons will stretch to parent's height
- Style
outline::Bool- Use 'outline' design for buttonsflat::Bool- Use 'flat' design for buttonsunelevated::Bool- Remove shadow from buttonsrounded::Bool- Applies a more prominent border-radius for squared shape buttonspush::Bool- Use 'push' design for buttonsglossy::Bool- Applies a glossy effect