StippleUI API
API
#
StippleUI.API.csscolors
— Method
`csscolors(name, color)`
`csscolors(names, colors)`
`csscolors(prefix, colors)`
Construct a css string that defines colors to be used for styling quasar elements; either as a value for the keyword argument color
or as a classname with the resective prefix text-
or bg-
. (cf. quasar docs)
Usage
css = style(csscolors(:stipple, [RGB(0.2, 0.4, 0.8), "#123456", RGBA(0.1, 0.2, 0.3, 0.5)]))
ui(model) = css * page(model, class="container, text-stipple-1", [ btn("Hit me", @click(:pressed), color="stipple-3") ])
Badges
#
StippleUI.Badges.badge
— Function
badge()
The badge
component allows you to create a small badge for adding information like contextual data that needs to stand out and get noticed. It is also often useful in combination with other elements like a user avatar to show a number of new messages.
Examples
Model
julia> @vars BadgeModel begin
myicon = "bluetooth"
end
View
julia> Html.div("Badge", class="text-h6", [
badge("1.0.0+", color="primary")
])
Arguments
-
Content
-
floating::Bool
- Tellbadge
if it should float to the top right side of the relative positioned parent element or not -
transparent::Bool
- Applies a 0.8 opacity; Useful especially for floatingbadge
-
multiline::Bool
- Content can wrap to multiple lines -
label::Union{String, Int}
- Badge’s content as string; overrides default slot if specified ex."John Doe"
22
-
align::String
- Sets vertical-align CSS attribute -
outline::Bool
- Use 'outline' design (colored text and borders only)
-
-
Style
-
color::String
- Color name for component from the Color Palette ex."primary"
"teal-10"
-
textcolor::String
- Overrides text color (if needed); Color name from the Color Palette ex."primary"
"teal-10"
-
rounded::Bool
- Makes a rounded shaped badge
-
Banners
banner(content::String = "", args...; buttons::Vector{String} = String[], icon::Union{String,Nothing} = nothing, kwargs...)
The banner
component creates a banner element to display a prominent message and related optional actions.
According to the Material Design spec, the banner should be “displayed at the top of the screen, below a top app bar” - but of course you can put one anywhere that makes sense, even in a dialog
Examples
View
julia> banner("Unfortunately, the credit card did not go through, please try again.", class="bg-primary text-white", [
template("", "v-slot:action", [
btn("Dismiss", flat=true, color="white"),
btn("Update Credit Card", flat=true, color="white")
])
])
julia> banner("Could not retrieve travel data.", rounded=true, class="bg-grey-3", [
template("", "v-slot:avatar", [
imageview(src="https://cdn.quasar.dev/img/mountains.jpg", style="width: 100px; height:64px")
]),
template("", "v-slot:action", [
btn("Retry", flat=true, color="white")
])
])
Arguments
-
Content
-
inlineactions::Bool
- Display actions on same row as content
-
-
Style
-
dense::Bool
- Dense mode; occupies less space -
rounded::Bool
- Applies a small standard border-radius for a squared shape of the component -
dark::Bool
- Notify the component that the background is a dark color
-
Bignumbers
#
StippleUI.BigNumbers.bignumber
— Function
bignumber(label::Union{String,Symbol} = "", number::Union{Symbol,Number,Nothing} = nothing, args...; kwargs...)
Renders a Big Number UI element.
Arguments
-
label::Union{String,Symbol}
-
number::Union{String,Symbol,Nothing,String}
-
icon::Union{String,Symbol}
-
color::Union{String,Symbol} = "positive"|"negative"
-
arrow::Union{String,Symbol} = "up"|"down"
Buttons
#
StippleUI.Buttons.btn
— Function
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.23
-
darkpercentage::Bool
- Progress bar on the background should have dark color; To be used along with 'percentage' and 'loading' props
-
-
Content
-
label::Union{String, Int}
- The text that will be shown on the button ex.Button Label
-
icon::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.map
ion-add
img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img:path/to/some_image.png
-
iconright::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.map
ion-add
img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img:path/to/some_image.png
-
nocaps::Bool
- Avoid turning label text into caps (which happens by default) -
nowrap::Bool
- Avoid label text wrapping -
align::String
- Label or content alignment default.center
accepted values.left
right
center
around
between
evenly
-
stack::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 tag so you can access events even if disable or 3) Use 'href' prop and specify 'type' as a media tag default.button
ex.a
submit
reset
button
image/png
href="https://some-site.net" target="_blank"
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value
-
-
Navigation
-
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.16px
2rem
xs
md
-
ripple::Union{Bool, Dict}
- Configure material ripple (disable it by setting it to 'false' or supply a config object) default.true
ex.false
{ "early" => true, "center" => true, "color" => "teal", "keyCodes" => [] }
-
outline::Bool
- Useoutline
design -
flat::Bool
- Useflat
design -
unelevated::Bool
- Remove shadow -
rounded::Bool
- Applies a more prominent border-radius for a squared shape button -
push::Bool
- Use 'push' design -
glossy::Bool
- Applies a glossy effect -
fab::Bool
- Makes button size and shape to fit a Floating Action Button -
fabmini::Bool
- Makes button size and shape to fit a small Floating Action Button -
padding::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 set -
color::String
- Color name for component from the Color Palette eg.primary
teal-10
-
textcolor::String
- Overrides text color (if needed); Color name from the Color Palette eg.primary
teal-10
-
dense::Bool
- Dense mode; occupies less space -
round::Bool
- Makes a circle shaped button
-
#
StippleUI.Buttons.btndropdown
— Method
btndropdown
is a very convenient dropdown button. Goes very well with list
as dropdown content, but it’s by no means limited to it.
In case you are looking for a dropdown “input” instead of “button” use Select instead.
Examples
julia> btndropdown(label = "Dropdown Button", color = "primary", [ list([ item("Spain", clickable = true, vclosepopup = true, @click("first_item = true")), item("USA", clickable = true, vclosepopup = true, @click("second_item = true")), item("Netherlands", clickable = true, vclosepopup = true, @click("third_item = true")) ]), ])
Arguments
-
Behavior
-
loading::Bool
- Put button into loading state (displays aspinner
— can be overridden by using a 'loading' slot) -
split::Bool
- Split dropdown icon into its own button -
disablemainbtn::Bool
- Disable main button (useful along with 'split' prop) -
disabledropdown::Bool
- Disables dropdown (dropdown button if using along 'split' prop) -
persistent::Bool
- Allows the menu to not be dismissed by a click/tap outside of the menu or by hitting the ESC key -
autoclose::Bool
- Allows any click/tap in the menu to close it; Useful instead of attaching events to each menu item that should close the menu on click/tap
-
-
Content
-
label::Union{String, Int}
- The text that will be shown on the button ex."Button Label"
-
icon::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."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
iconright::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."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
nocaps::Bool
- Avoid turning label text into caps (which happens by default) -
nowrap::Bool
- Avoid label text wrapping -
align::String
- Label or content alignment default.center
ex."left"
"right"
"center"
"around"
"between"
"evenly"
-
stack::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 -
split::Bool
- Split dropdown icon into its own button -
dropdownicon::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."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
-
General
-
type::String
- 1) Define the button native type attribute (submit, reset, button) or 2) render component with tag so you can access events even if disable or 3) Use 'href' prop and specify 'type' as a media tag default."button"
ex."a"
"submit"
"reset"
"button"
"image/png"
href="https://some-site.net" target="_blank"
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value ex.0
100
-
-
Navigation
-
Position
-
cover::Bool
- Allows the menu to cover the button. When used, the 'menu-self' and 'menu-fit' props are no longer effective -
menuanchor::String
- Two values setting the starting position or anchor point of the menu relative to its target default."bottom end"
ex."top start"
"bottom start"
"top end"
"bottom end"
"right start"
"right end"
"left start"
"left end"
-
menuself::String
- Two values setting the menu’s own position relative to its target default."top end"
ex."top start"
"bottom start"
"top end"
"bottom end"
"right start"
"right end"
"left start"
"left end"
-
menuoffset::Vector
- An array of two numbers to offset the menu horizontally and vertically in pixels ex.[8,8]
[5,10]
-
-
State
-
loading::Bool
- Put button into loading state (displays aspinner
— can be overridden by using a 'loading' slot) -
disable::Bool
- Put compontent in disabled state
-
-
Style
-
size::String
- Size in CSS units or percentage, ex."25px"
"2.5em"
"md"
"xs"
-
ripple::Union{Bool, Dict}
- Configure material ripple (disable it by setting it to 'false' or supply a config object) default.true
ex.false
{ "early" => true, "center" => true, "color" => "teal", "keyCodes" => []}
-
outline::Bool
- Use 'outline' design -
flat::Bool
- Use 'flat' design -
unelevated::Bool
- Remove shadow -
rounded::Bool
- Applies a more prominent border-radius for a squared shape button -
push::Bool
- Use 'push' design -
glossy::Bool
- Applies a glossy effect -
fab::Bool
- Makes button size and shape to fit a Floating Action Button -
fabmini::Bool
- Makes button size and shape to fit a Floating Action Button Mini -
padding::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 set ex."16px"
,"2rem"
,"xs"
,"md lg"
,"2px 2px 5px 7px"
-
color::String
- Color name for component from the Quasar Color Palette ex."primary"
"teal-10"
-
textcolor::String
- Overrides text color (if needed); Color name from the Quasar Color Palette ex."white"
"primary"
"teal-10"
-
dense::Bool
- Dense mode; occupies less space -
noiconanimation::Bool
- Disables the rotation of the dropdown icon when state is toggled -
contentstyle::Union{Vector, String, Dict}
- Style definitions to be attributed to the menu ex.{"background-color" => "#ff0000"}
contentclass!="{ 'my-special-class': <condition> }"
-
contentclass::Union{Vector, String, Dict}
- Class definitions to be attributed to the menu ex."my-special-class"
contentclass!="{ 'my-special-class': <condition> }"
-
#
StippleUI.Buttons.btngroup
— Method
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 space -
stretch::Bool
- When used on flexbox parent, buttons will stretch to parent’s height
-
-
Style
-
outline::Bool
- Use 'outline' design for buttons -
flat::Bool
- Use 'flat' design for buttons -
unelevated::Bool
- Remove shadow from buttons -
rounded::Bool
- Applies a more prominent border-radius for squared shape buttons -
push::Bool
- Use 'push' design for buttons -
glossy::Bool
- Applies a glossy effect
-
Cards
#
StippleUI.Cards.card
— Method
card(args...; kwargs...)
Card
component is a great way to display important pieces of grouped content. The Card
component is intentionally lightweight and essentially a containing element that is capable of “hosting” any other component that is appropriate.
Examples
Model
julia> @vars CardModel begin
lorem::R{String} = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
url::R{String} = "https://cdn.quasar.dev/img/parallax2.jpg"
end
View
julia> card(class="my-card", [
imageview(src=:url, basic=true, [
Html.div("Title", class="absolute-bottom text-h6")
]),
card_section("{{lorem}}")
])
Arguments
-
Content *
tag::String
- HTML tag to render default"div"
ex."div"
"form"
-
Style *
dark::Bool
- Notify the component that the background is a dark color *square::Bool
- Removes border-radius so borders are squared *flat::Bool
- Applies a 'flat' design (no default shadow) *bordered::Bool
- Applies a default border to the component
#
StippleUI.Cards.card_actions
— Method
Examples
card_actions()
Model
julia> @vars CardModel begin
lorem::R{String} = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
end
View
julia> card(class="my-card bg-secondary text-white", [
card_section([
Html.div("Our Changing Planet", class="text-h6"),
Html.div("by John Doe", class="text-subtitle2")
]),
card_section("{{ lorem }}"),
card_actions([
btn(flat=true, "Action 1"),
btn(flat=true, "Action2")
])
])
Arguments
-
align::String
- Specify how to align the actions ("left", "center", "right", "between", "around", "evenly", "stretch") -
vertical:Bool
- Display actions one below the other
#
StippleUI.Cards.card_section
— Method
card_section(args...; kwargs...)
Examples
View
julia> card(class="text-white", style="background: radial-gradient(circle, #35a2ff 0%, #014a88 100%); width: 30%", [
card_section("lorLorem Ipsum is simply dummy text of the printing
and typesetting industry")
])
Arguments
-
tag::String
- HTML tag to render ex."div"
,"form"
-
horizontal::Bool
- Display a horizontal section (will have no padding and can contain othercard_section
)
Checkboxes
#
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 URL -
indeterminatevalue::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 component -
leftlabel::Bool
- Label (if any specified) should be displayed on the left side of the component
-
-
Model
-
fieldname::Symbol
- Model of the component -
val::Union{String, Float64, Int, Bool}
- Works when model ('value') is Array. It tells the component which value should add/remove when ticked/unticked -
truevalue::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 color -
dense::Bool
- Dense mode; occupies less space
-
Chips
#
StippleUI.Chips.chip
— Method
chip(args...; kwargs...)
The chip
component is basically a simple UI block entity, representing for example more advanced underlying data, such as a contact, in a compact way.
Chips can contain entities such as an avatar, text or an icon, optionally having a pointer too. They can also be closed or removed if configured so.
Examples
View
julia> chip("Add to calendar", icon="event")
Arguments
-
Content
-
icon::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."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
iconright::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."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
iconremove::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."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
iconselected::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."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
label::Union{String, Int}
- Chip’s content as string; overrides default slot if specified ex."Joe Doe"
"Book"
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value ex.0
100
-
-
Model
-
value::Bool
- Model of the component determining ifchip
should be rendered or not default.true
-
selected::Bool
- Model forchip
if it’s selected or not NOTE. ".sync" modifier required!
-
-
State
-
clickable::Bool
- Ischip
clickable? If it’s the case, then it will add hover effects and emit 'click' events -
removable::Bool
- Ischip
removable? If it’s the case, then it will add a close button and emit 'remove' events -
disable::Bool
- Put component in disabled mode
-
-
Style
-
ripple::Union{Bool, Dict}
- Configure material ripple (disable it by setting it to 'false' or supply a config object) default.true
ex.false
{ early: true, center: true, color: 'teal', keyCodes: [] }
-
dense::Bool
- Dense mode; occupies less space -
size::String
-chip
size name or a CSS unit including unit name ex."xs"
"sm"
"md"
"lg"
"xl"
"1rem"
-
dark::Bool
- Notify the component that the background is a dark color -
color::String
- Color name for component from the Color Palette eg."primary"
"teal-10"
-
square::Bool
- Sets a low value for border-radius instead of the default one, making it close to a square -
outline::Bool
- Display using the 'outline' design
-
Datepickers
#
StippleUI.DatePickers.DateRange
— Type
DateRange
Represents a date interval, between start
and stop
, with a 1 day step.
#
StippleUI.DatePickers.datepicker
— Function
datepicker()
Renders a date picker (calendar) input element. If the fieldname
references a Vector{Date}
, the multiple
keyword parameter must be passed as true
. If the fieldname
references a DateRange
, the range
keyword parameter must be passed as true
. If the fieldname
references a Vector{DateRange}
, both the multiple
and the range
keyword parameters must be passed as true
.
Examples
Model
julia> @vars DatePickers begin
date::R{Date} = today() + Day(30)
dates::R{Vector{Date}} = Date[today()+Day(10), today()+Day(20), today()+Day(30)]
daterange::R{DateRange} = DateRange(today(), (today() + Day(3)))
dateranges::R{Vector{DateRange}} = [
DateRange(today(), (today() + Day(3))),
DateRange(today() + Day(7), (today() + Day(10))),
DateRange(today() + Day(14), (today() + Day(17))),
]
proxydate::R{Date} = today()
inputdate::R{Date} = today()
end
View
julia> datepicker(:date)
julia> datepicker(:dates, multiple = true)
julia> datepicker(:daterange, range = true)
julia> datepicker(:dateranges, range = true, multiple = true)
Arguments
-
Behavior
-
name::String
- Used to specify the name of the control; Useful if dealing with forms submitted directly to a URL ex."car_id"
-
landscape::Bool
- Display the component in landscape mode -
yearsinmonthview::Bool
- Show the years selector in months view
-
-
Content
-
title::String
- When specified, it overrides the default header title; Makes sense when not in 'minimal' mode ex."Birthday"
-
subtitle::String
- When specified, it overrides the default header subtitle; Makes sense when not in 'minimal' mode ex."John Doe"
-
todaybtn::Bool
- Display a button that selects the current day -
minimal::Bool
- Don’t display the header
-
-
Selection
-
navminyearmonth::String
- Lock user from navigating below a specific year+month (in YYYY/MM format); This prop is not used to correct the model; You might want to also use 'default-year-month' prop ex."2020/07"
-
navmaxyearmonth::String
- Lock user from navigating above a specific year+month (in YYYY/MM format); This prop is not used to correct the model; You might want to also use 'default-year-month' prop ex."2020/10"
-
nounset::Bool
- Remove ability to unselect a date; It does not apply to selecting a range over already selected dates -
multiple::Bool
- Allow multiple selection; Model must be Array -
range::Bool
- Allow range selection; Partial compatibility with 'options' prop: selected ranges might also include 'unselectable' days
-
-
State
-
readonly::Bool
- Put component in readonly mode -
disable::Bool
- Put component in disabled mode
-
-
Style
-
color::String
- Color name for component from the Quasar Color Palette ex."primary"
"teal-10"
-
textcolor::String
- Overrides text color (if needed); Color name from the Quasar Color Palette ex."primary"
"teal-10"
-
dark::Bool
- Notify the component that the background is a dark color -
square::Bool
- Removes border-radius so borders are squared -
flat::Bool
- Applies a 'flat' design (no default shadow) -
bordered::Bool
- Applies a default border to the component -
eventcolor::String
- Color name (from the Quasar Color Palette); If using a function, it receives the date as a String and must return a String (color for the received date); If using a function then for best performance, reference it from your scope and do not define it inline ex."teal-10"
eventcolor!="(date) => date[9] % 2 === 0 ? 'teal' : 'orange'"
-
Dialogs
#
StippleUI.Dialogs.dialog
— Method
dialog()
The dialog`
component is a great way to offer the user the ability to choose a specific action or list of actions. They also can provide the user with important information, or require them to make a decision (or multiple decisions).
Dialogs can also be used as a globally available method for more basic use cases, like the native JS alert() , prompt() , etc.
|
Examples
Model
julia> @vars DialogModel begin
show_dialog::R{Bool} = false
end
View
julia> Html.div(class="q-pa-md q-gutter-sm", [
btn("Alert", color="primary", @click("show_dialog = true")),
StippleUI.dialog(:show_dialog, [
card([
card_section(Html.div(class="text-h6", "Alert")),
card_section(class="q-pt-none", "Lorem ipsum dolor sit amet consectetur adipisicing elit.
Rerum repellendus sit voluptate voluptas eveniet porro. Rerum blanditiis perferendis totam,
ea at omnis vel numquam exercitationem aut, natus minima, porro labore.")
])
])
])
Arguments
-
Behaviour
-
persistent::Bool
- User cannot dismiss Dialog if clicking outside of it or hitting ESC key; Also, an app route change won’t dismiss it -
noesc::Bool
- User cannot dismiss Dialog by hitting ESC key; No need to set it if 'persistent' property is also set -
nobackdrop::Bool
- User cannot dismiss Dialog by clicking outside of it; No need to set it if 'persistent' property is also set -
autoclose::Bool
- Any click/tap inside of the dialog will close it -
transitionshow::String
- One of the embedded transitions eg."fade"
,"slide-down"
-
transitionhide::String
- One of the embedded transitions eg."fade"
,"slide-down"
-
norefocus::Bool
- (Accessibility) When Dialog gets hidden, do not refocus on the DOM element that previously had focus -
nofocus::Bool
- (Accessibility) When Dialog gets shown, do not switch focus on it
-
-
Content
-
seamless::Bool
- Put Dialog into seamless mode; Does not use a backdrop so user is able to interact with the rest of the page too -
maximized::Bool
- Put Dialog into maximized mode -
fullwidth::Bool
- Dialog will try to render with same width as the window -
fullheight::Bool
- Dialog will try to render with same height as the window -
position::String
- Stick dialog to one of the sides ("top", "right", "bottom" or "left")
-
-
Style
-
contentclass::Union{Array, String}
- Class definitions to be attributed to the content eg."my-special-class"
:content-class="{ 'my-special-class': <condition> }"
-
contentstyle::Union{Array, String}
- Style definitions to be attributed to the content eg."background-color: #ff0000"
:content-style="{ color: '#ff0000' }"
-
square::Bool
- Forces content to have squared borders
-
Editors
#
StippleUI.Editors.editor
— Method
editor(fieldname, args…; kwargs…)
Component is a WYSIWYG (“what you see is what you get”) editor component that enables the user to write and even paste HTML.
Examples
Model
julia> @vars EditorModel begin
s_editor::R{String} = "What you see is <b>what</b> you get."
end
View
julia> editor(:s_editor, minheight="5rem")
julia> StippleUI.form( autocorrect="off", autocapitalize="off", autocomplete="off", spellcheck="false", [
editor(:s_editor)
])
Arguments
-
Behaviour
-
fullscreen::Bool
- Fullscreen mode (Note".sync" modifier required!) Example.:fullscreen.sync="isFullscreen"
-
noroutefullscreenexit::Bool
- Changing route app won’t exit fullscreen -
paragraphtag::String
- Paragraph tag to be used Example.div
,p
-
-
Content
-
placeholder::String
- Text to display as placeholder ex.Type your story here...
-
-
Model
-
value::String
[required!] - Reactive Model of the component
-
-
State
-
readonly::Bool
- Put component to readonly mode -
disable::Bool
- Disable component
-
-
Style *
square::Bool
- Removes border-radius so borders are squared *minheight::String
- Minimum height of the component default.10rem
ex.15rem
50vh
*flat::Bool
- Applies a 'flat' design (no borders) *dark::Bool
- Notify the component that the background is a dark color *maxheight::String
- CSS unit for maximum height of the input area ex.100px
90vh
*height::String
- CSS value to set the height of the editable area ex.100px
90vh
*toolbaroutline::Bool
- Toolbar buttons are rendered "outlined" *toolbarpush::Bool
- Toolbar buttons are rendered as a "push-button" type *toolbarrounded::Bool
- Toolbar buttons are rendered "rounded" *contentstyle::Dict
- Object with CSS properties and values for styling the container ofeditor
ex.contentstyle!="{ backgroundColor: '#C0C0C0' }"
*contentclass::Union{Dict, Vector, String}
- CSS classes for the input area ex.my-special-class
contentclass!="{ 'my-special-class': <condition> }"
Forminputs
#
StippleUI.FormInputs.filefield
— Function
filefield( label::Union{String, Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args…; kwargs…)
#
StippleUI.FormInputs.numberfield
— Function
numberfield( label::Union{String, Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
#
StippleUI.FormInputs.textarea
— Function
textarea(label::Union{String,Symbol} = "", fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
#
StippleUI.FormInputs.textfield
— Function
textfield(fieldname, args...; kwargs...)
Examples
Model
julia> @vars TextField begin
name::R{String} = ""
end
View
julia> textfield("What's your name *", :name, name = "name", @iif(:warin), :filled, hint = "Name and surname", "lazy-rules",
rules = "[val => val && val.length > 0 || 'Please type something']"
)
Arguments
-
General *
type::String
- Must be one of the following:text (default)
,textarea
,email
,tel
,number
,password
andurl
. This is important as it determines the keyboard type popping up on mobile devices. -
Behaviour *
name::String
- Used to specify the name of the control; Useful if dealing with forms; If not specified, it takes the value of 'for' prop, if it exists ex.car_id
*mask::String
- Custom mask or one of the predefined mask names ex.date
datetime
time
fulltime
phone
card
*fillmask::Union{Bool, String}
- Fills string with specified characters (or underscore if value is not string) to fill mask’s length ex.true
0
_
*reversefillmask::Bool
- Fills string from the right side of the mask *unmaskedvalue::Bool
- Model will be unmasked (won’t contain tokens/separation characters) *error::Bool
- Does field have validation errors? *rules::Vector
- Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules ex.rules!="[ 'fulltime' ]"
rules!="[ val => val.length <= 3 || 'Please use maximum 3 characters' ]"
*reactiverules::Bool
- By default a change in the rules does not trigger a new validation until the model changes; If set to true then a change in the rules will trigger a validation; Has a performance penalty, so use it only when you really need it *lazyrules::Union{Bool, String}
- If set to boolean true then it checks validation status against the 'rules' only after field loses focus for first time; If set to 'ondemand' then it will trigger only when component’s validate() method is manually called or when the wrapperform
submits itselftrue
false
ondemand
*loading::Bool
- Signals the user a process is in progress by displaying a spinner; Spinner can be customized by using the 'loading' slot. *clearable::Bool
- Appends clearable icon when a value (not undefined or null) is set; When clicked, model becomes null *autofocus::Bool
- Focus field on initial component render *for::String
- Used to specify the 'id' of the control and also the 'for' attribute of the label that wraps it; If no 'name' prop is specified, then it is used for this attribute as well ex.myFieldsId
-
Content *
errormessage::String
- Validation error message (gets displayed only if 'error' is set to 'true') ex.Username must have at least 5 characters
*noerroricon::Bool
- Hide error icon when there is an error *label::Union{String,Symbol}
- A text label that will “float” up above the input field, once the field gets focus ex.Username
*stacklabel::Bool
- Label will be always shown above the field regardless of field content (if any) *hint::String
- Helper (hint) text which gets placed below your wrapped form component ex.Fill in between 3 and 12 characters
*hidehint::Bool
- Hide the helper (hint) text when field doesn’t have focus *prefix::String
- Prefix ex.$
*suffix::String
- Suffix ex.@gmail.com
*loading::Bool
- Signals the user a process is in progress by displaying a spinner; Spinner can be customized by using the 'loading' slot. *clearable::Bool
- Appends clearable icon when a value (not undefined or null) is set; When clicked, model becomes null *clearicon::String
- Custom icon to use for clearable icon; If not specified, then it uses the default icon *labelslot::Bool
- Enables label slot; You need to set it to force use of the 'label' slot if the 'label' prop is not set *bottomslots::Bool
- Enables bottom slots ('error', 'hint', 'counter') *counter::Bool
- Show an automatic counter on bottom right *shadowtext::String
- Text to be displayed as shadow at the end of the text in the control; Does NOT applies to type=file *autogrow::Bool
- Make field autogrow along with its content (uses a textarea) -
State *
disable::Bool
- Put component in disabled mode *readonly::Bool
- Put component in readonly mode -
Style *
labelcolor::String
- Color name for the label from the Color Palette; Overrides the 'color' prop; The difference from 'color' prop is that the label will always have this color, even when field is not focused ex.primary
teal
*color::String
- Color name for component from the Color Palette *bgcolor::String
- Color from Color Palette *dark::Bool
- Notify the component that the background is a dark color *filled::Bool
- Use 'filled' design for the field *outline::Bool
- Use 'outlined' design for the field *borderless::Bool
- Use 'borderless' design for the field *standout::Union{Bool, String}
- Use 'standout' design for the field; Specifies classes to be applied when focused (overriding default ones) ex.standout
standout="bg-primary text-white"
*hidebottomspace::Bool
- Do not reserve space for hint/error/counter anymore when these are not used; As a result, it also disables the animation for those; It also allows the hint/error area to stretch vertically based on its content *rounded::Bool
- Applies a small standard border-radius for a squared shape of the component *square::Bool
- Remove border-radius so borders are squared; Overrides 'rounded' prop *dense::Bool
- Dense mode; occupies less space *itemaligned::Union{Vector, String, Dict}
- Match inner content alignment to that ofitem
*inputclass::Union{Vector, String, Dict}
- Class definitions to be attributed to the underlying input tag ex.my-special-class
inputclass!="{ 'my-special-class': <condition> }"
*inputstyle::Union{Vector, String, Dict}
- Style definitions to be attributed to the underlying input tag ex.background-color: #ff0000
inputstyle!="{ backgroundColor: #ff0000 }"
-
Model *
debounce::Union{String, Int}
- Debounce amount (in milliseconds) when updating model ex.0
500
*maxlength::Union{String, Int}
- Specify a max length of model ex.12
Forms
#
StippleUI.Forms.form
— Method
form(args...; noresetfocus::Bool = false, kwargs...)
The form
component renders a <form> DOM element and allows you to easily validate child form components (like input
, select
or your field
wrapped components) that have the internal validation (NOT the external one) through rules associated with them.
Examples
Model
julia> @vars FormModel begin
name::R{String} = ""
age::R{Int} = 0
warin::R{Bool} = true
end
View
julia> StippleUI.form(action = "/sub", method = "POST", [
textfield("What's your name *", :name, name = "name", @iif(:warin), :filled, hint = "Name and surname", "lazy-rules",
rules = "[val => val && val.length > 0 || 'Please type something']"
),
numberfield("Your age *", :age, name = "age", "filled", :lazy__rules,
rules = "[val => val !== null && val !== '' || 'Please type your age',
val => val > 0 && val < 100 || 'Please type a real age']"
),
btn("submit", type = "submit", color = "primary")
])
Arguments
-
autofocus::Bool
- Focus first focusable element on initial component render -
noerrorfocus::Bool
- Do not try to focus on first component that has a validation error when submitting form -
noresetfocus::Bool
- Do not try to focus on first component when resetting form -
greedy::Bool
- Validate all fields in form (by default it stops after finding the first invalid field with synchronous validation)
Icons
#
StippleUI.Icons.icon
— Method
icon(name::Union{String,Symbol}, args...; content::Union{String,Vector,Function} = "", kwargs...)
Stipple supports out of the box: Material Icons , Font Awesome, Ionicons, MDI, Eva Icons, Themify Icons, Line Awesome and Bootstrap Icons.
Furthermore you can add support by yourself for any icon lib.
Examples
View
julia> icon("font_download", class="text-primary", style="font-size: 32px;")
julia> icon("warning", class="text-red", style="font-size:4rem;")
julia> icon("format_size", style="color: #ccc; font-size: 1.4em;")
julia> icon("print", class="text-teal", style="font-size: 4.4em;")
julia> icon("today", class="text-orange", style="font-size: 2em;")
julia> icon("style", style="font-size: 3em;")
Arguments
-
Content
-
tag::String
- HTML tag to render, unless no icon is supplied or it’s an svg icon ex.div
i
-
left::Bool
- Useful if icon is on the left side of something: applies a standard margin on the right side of Icon -
right::Bool
- Useful if icon is on the right side of something: applies a standard margin on the left side of Icon
-
-
Model
-
name::String
- Icon name; 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.map
ion-add
img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img:path/to/some_image.png
-
-
Style
-
size::String
- Size in CSS units, including unit name or standard size name16px
2rem
xs
md
-
color::String
- Color name for component from the Color Palette eg.primary
teal-10
-
Imageviews
#
StippleUI.ImageViews.imageview
— Method
imageview(args...; kwargs...)
The imageview
component makes working with images (any picture format) easy and also adds a nice loading effect to it along with many other features (example: the ability to set an aspect ratio).
Examples
Model
julia> @vars Model begin
url::R{String} = "https://placeimg.com/500/300/nature"
end
View
julia> imageview(src = :url, spinnercolor = "white", style = "height: 140px; max-width: 150px" )
julia> imageview(src = :url, style = "height: 140px; max-width: 150px", [
template("", "v-slot:loading", [spinner(:gears, color = "white", wrap = StippleUI.NO_WRAPPER)]),
])
Arguments
-
Behaviour *
transition::String
- One of embedded transitions ex.fade
slide-down
*nativecontextmenu::Bool
- Enable the native context menu of the image -
Content *
ratio::Union{String, Int}
- Force the component to maintain an aspect ratio ex.ratio!="4/3"
(Number format) ratio!="16/9"
(String format) ratio="1"
*alt::String
- Specifies an alternate text for the image, if the image cannot be displayed ex.Two cats
*basic::Bool
- Do not use transitions; faster render *contain::Bool
- Make sure that the image getting displayed is fully contained, regardless if additional blank space besides the image is needed on horizontal or vertical -
Model *
src::String
- Path to image ex.(public folder) src="img/something.png"
(assets folder) src="~assets/my-img.gif"
(URL) src="https://placeimg.com/500/300/nature"
*srcset::String
- Same syntax as image:[] srcset attribute. ex.elva-fairy-320w.jpg 320w, elva-fairy-480w.jpg 480w
*sizes::String
- Same syntax as image:[] sizes attribute. ex.(max-width: 320px) 280px, (max-width: 480px) 440px, 800px
*width::String
- Forces image width; Must also include the unit (px or %) ex.280px
70%
*height::String
- Forces image height; Must also include the unit (px or %) ex.280px
70%
*placeholdersrc::String
- While waiting for your image to load, you can use a placeholder image ex.(public folder) src="img/something.png"
(assets folder) src="~assets/my-img.gif"
(URL) src="https://placeimg.com/500/300/nature"
-
Style
-
color::String
- Color name for component from the Color Palette eg.primary
teal-10
-
imgclass::Union{Vector, String, Dict}
- Class definitions to be attributed to the container of image; Does not apply to the caption ex.my-special-class
imgclass!="{ 'my-special-class': <condition> }"
-
imgstyle::Dict
- Apply CSS to the container of the image; Does not apply to the caption ex.imgstyle!="{ transform: 'rotate(45deg)' }"
-
spinnercolor::String
- Color name for default Spinner (unless using a 'loading' slot)primary
teal-10
-
spinnersize::String
- Size in CSS units, including unit name, for default Spinner (unless using a 'loading' slot) ex.16px
2rem
-
Knobs
#
StippleUI.Knobs.knob
— Function
knob(range::AbstractRange{T} where T <: Real, fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
Renders a knob input element.
Lists
#
StippleUI.Lists.item
— Method
item(args...; kwargs...)
Arguments
-
Content
-
tag::String
- HTML tag to render; Suggestion: use 'label' when encapsulating acheckbox
/radio
/toggle
so that when user clicks/taps on the whole item it will trigger a model change for the mentioned components ex.a
label
div
-
insetlevel::Int
- Apply an inset; Useful when avatar/left side is missing but you want to align content with other items that do have a left side, or when you’re building a menu ex.insetlevel!="1"
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value ex.0
100
-
-
Navigation
-
State
-
disable::Bool
- Put component in disabled mode -
active::Bool
- Put item into 'active' state -
clickable::Bool
- Isitem
clickable? If it’s the case, then it will add hover effects and emit 'click' events -
manualfocus::Bool
- Put item into a manual focus state; Enables 'focused' prop which will determine if item is focused or not, rather than relying on native hover/focus states -
focused::Bool
- Determines focus state, ONLY if 'manual-focus' is enabled / set to true
-
-
Style
-
dark::Bool
- Notify the component that the background is a dark color -
dense::Bool
- Dense mode; occupies less space
-
#
StippleUI.Lists.item_label
— Method
item_label(args...; kwargs...)
Arguments
-
Behaviour
-
lines::Union{Int, String}
- Apply ellipsis when there’s not enough space to render on the specified number of lines; ex.1
3
lines!="2"
-
-
Content
-
overline::Bool
- Renders an overline label -
caption::Bool
- Renders a caption label -
header::Bool
- Renders a header label -
lines::Union{Int, String}
- Apply ellipsis when there’s not enough space to render on the specified number of lines;1
3
lines!="2"
-
#
StippleUI.Lists.item_section
— Method
item_section(args...; kwargs...)
Arguments
-
avatar::Bool
- Render an avatar item side (does not needs 'side' prop to be set) -
thumbnail::Bool
- Render a thumbnail item side (does not needs 'side' prop to be set) -
side::Bool
- Renders as a side of the item -
top::Bool
- Align content to top (useful for multi-line items) -
nowrap::Bool
- Do not wrap text (useful for item’s main content)
#
StippleUI.Lists.list
— Method
list(args...; kwargs...)
The list
and item
are a group of components which can work together to present multiple line items vertically as a single continuous element. They are best suited for displaying similar data types as rows of information, such as a contact list, a playlist or menu. Each row is called an Item. item
can also be used outside of a list
too.
Examples
View
julia> list(bordered=true, separator=true, [
item(clickable=true, vripple=true, [
itemsection("Single line item")
]),
item(clickable=true, vripple=true, [
itemsection([
itemlabel("Item with caption"),
itemlabel("Caption", caption=true)
])
]),
item(clickable=true, vripple=true, [
itemsection([
itemlabel("OVERLINE", overline=true),
itemlabel("Item with caption")
])
])
])
Arguments
-
Content
-
separator::Bool
- Applies a separator between contained items -
padding:Bool
- Applies a material design-like padding on top and bottom
-
-
Style
-
bordered::Bool
- Applies a default border to the component -
dense::Bool
- Dense mode; occupies less space -
dark::Bool
- Notify the component that the background is a dark color
-
Menus
menu(fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector} = "", kwargs...)
The menu
component is a convenient way to show menus. Goes very well with list
as dropdown content, but it’s by no means limited to it.
Examples
View
julia> btn("Basic Menu", color="primary", [StippleUI.menu( [p("Hello")])
Arguments
-
Behaviour
-
target::Union{Bool, String}
- Configure a target element to trigger component toggle; 'true' means it enables the parent DOM element, 'false' means it disables attaching events to any DOM elements; By using a String (CSS selector) or a DOM element it attaches the events to the specified DOM element (if it exists) default value.true
ex.target!=false
target!=".my-parent"
-
noparentevent::Bool
- Skips attaching events to the target DOM element (that trigger the element to get shown) -
contextmenu::Bool
- Allows the component to behave like a context menu, which opens with a right mouse click (or long tap on mobile) -
scrolltarget::Union{String}
- CSS selector or DOM element to be used as a custom scroll container instead of the auto detected one ex.scrolltarget=".scroll-target-class"
scrolltarget="#scroll-target-id"
scrolltarget="body"
-
-
Position
-
fit::Bool
- Allows the menu to match at least the full width of its target -
cover::Bool
- Allows the menu to cover its target. When used, the 'self' and 'fit' props are no longer effective -
anchor::String
- Two values setting the starting position or anchor point of the menu relative to its target ex.anchor="top left"
anchor="bottom right"
anchor="center"
-
self::String
- Two values setting the menu’s own position relative to its target ex.self="top left"
self="bottom right"
self="center"
-
offset::Vector
- An array of two numbers to offset the menu horizontally and vertically in pixels ex.[8, 8]
[5, 10]
-
-
Style
-
contentclass::Union{Vector, String, Dict}
- Class definitions to be attributed to the content ex.my-special-class
contentclass!="{ 'my-special-class': <condition> }"
-
contentstyle::Union{Vector, String, Dict}
- Style definitions to be attributed to the content ex.backgroundcolor: #ff0000
contentstyle!="{ color: '#ff0000' }"
-
dark::Bool
- Notify the component that the background is a dark color -
square::Bool
- Forces content to have squared borders -
maxheight::String
- The maximum height of the menu; Size in CSS units, including unit name ex.16px
2rem
-
maxwidth::String
- The maximum width of the menu; Size in CSS units, including unit name ex.16px
2rem
-
Popupproxies
#
StippleUI.PopupProxies.popup_proxy
— Function
popup_proxy(fieldname::Union{Symbol,Nothing} = nothing, args...; content::Union{String,Vector,Function} = "", kwargs...)
popupproxy
should be used when you need either a menu
(on bigger screens) or a dialog
(on smaller screens) to be displayed. It acts as a proxy which picks either of the two components to use. popupproxy
also handles context-menus.
Examples
View
julia> btn("Handles click", push=true, color="primary", [
popupproxy([
banner("You have lost connection to the internet. This app is offline.", [
template("", "v-slot:avatar", [
icon("signal_wifi_off", color="Primary")
])
])
])
])
Arguments
-
Behaviour
-
target::Union{Bool, String}
- Configure a target element to trigger component toggle; 'true' means it enables the parent DOM element, 'false' means it disables attaching events to any DOM elements; By using a String (CSS selector) or a DOM element it attaches the events to the specified DOM element (if it exists) ex.true
ex.target!=false
target!=".my-parent"
-
noparentevent::Bool
- Skips attaching events to the target DOM element (that trigger the element to get shown) -
contextmenu::Bool
- Allows the component to behave like a context menu, which opens with a right mouse click (or long tap on mobile) -
breakpoint::Union{Int, String}
- Breakpoint (in pixels) of window width/height (whichever is smaller) from where a Menu will get to be used instead of a Dialog ex.992
breakpoint!="1234"
-
Radios
#
StippleUI.Radios.radio
— Function
radio(label::AbstractString = "", fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
The radio
component is another basic element for user input. You can use this to supply a way for the user to pick an option from multiple choices.
Examples
Model
julia> @vars RadioModel begin
shape::R{String} = "line"
end
View
julia> radio("Line", :shape, val="line")
julia> radio("Rectangle", :shape, val="rectange")
julia> radio("Ellipse", :shape, val="ellipse")
julia> radio("Polygon", :shape, val="polygon")
Arguments
-
Behaviour
-
name::String
- Used to specify the name of the control; Useful if dealing with forms submitted directly to a URL ex.car_id
-
keep-color::Bool
- Should the color (if specified any) be kept when checkbox is unticked?
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value
-
-
Label
-
leftlabel::Bool
- Label (if any specified) should be displayed on the left side of the checkbox
-
-
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 ex.primary
teal-10
-
dark::Bool
- Notify the component that the background is a dark color -
dense::Bool
- Dense mode; occupies less space
-
Ranges
#
Base.range
— Function
range(range::AbstractRange{<:Union{Symbol, String, Real}}, fieldname::Union{Symbol,Nothing} = nothing, args...; lazy = false, kwargs...)
The range
component is a great way to offer the user the selection of a sub-range of values between a minimum and maximum value, with optional steps to select those values. An example use case for the Range component would be to offer a price range selection
Examples
Model
julia> @vars RangeModel begin
range_data::R{RangeData{Int}} = RangeData(18:80)
end
View
julia> range(18:1:90,
:range_data;
label=true,
color="purple",
labelalways=true,
labelvalueleft=Symbol("'Min age: ' + range_data.min"),
labelvalueright=Symbol("'Max age: ' + range_data.max")
)
Arguments
-
Behaviour
-
name::String
- Used to specify the name of the control; Useful if dealing with forms submitted directly to a URL ex.car_id
-
snap::Bool
- Snap on valid values, rather than sliding freely; Suggestion: use with 'step' property -
reverse::Bool
- Work in reverse (changes direction) -
vertical::Bool
- Display in vertical direction -
labelalways::Bool
- Always display the label
-
-
Content
-
label::Bool
- Popup a label when user clicks/taps on the slider thumb and moves it -
markers::Union{Bool, Int}
- Display markers on the track, one for each possible value for the model or using a custom step (when specifying a Number) ex.markers
markers="5"
-
dragrange::Bool
- User can drag range instead of just the two thumbs -
dragonlyrange::Bool
- User can drag only the range instead and NOT the two thumbs
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value ex.0
100
-
-
Labels
-
labelcolorleft::String
- Color name for left label background from the Color Palette ex.primary
teal-10
-
labeltextcolorleft::String
- Color name for left label text from the Color Palette ex.primary
teal-10
-
labelcolorright::String
- Color name for right label background from the Color Palette ex.primary
teal-10
-
labeltextcolorright::String
- Color name for right label text from the Color Palette ex.primary
teal-10
-
labelvalueleft::Union{String, Int}
- Override default label for min value ex.labelvalueleft="model.min + 'px'"
-
labelvalueright::Union{String, Int}
- Override default label for max value ex.labelvalueright="model.max + 'px'"
-
-
Model
-
range::AbstractRange{T}
- The range of values to select from min:step:max, symbols or strings can be used to reference model fields, e.g.range("min":2:"max", :myvalue)
-
lazy::Bool
- If true, update the value of the model field only upon release of the slider
-
-
State
-
disable::Bool
- Put component in disabled mode -
readonly::Bool
- Put component in readonly mode
-
-
Style
-
color::String
- Color name for component from the Color Palette ex.primary
teal-10
-
labelcolor::String
- Color name for component from the Color Palette ex.primary
teal-10
-
thumbpath::String
- Set custom thumb svg path ex.M5 5 h10 v10 h-10 v-10
-
dark::Bool
- Notify the component that the background is a dark color -
dense::Bool
- Dense mode; occupies less space
-
#
StippleUI.Ranges.slider
— Function
slider(range::AbstractRange{<:Union{Symbol, String, Real}}, fieldname::Union{Symbol,Nothing} = nothing, args...; lazy = false, kwargs...)
The slider
is a great way for the user to specify a number value between a minimum and maximum value, with optional steps between valid values. The slider also has a focus indicator (highlighted slider button), which allows for keyboard adjustments of the slider.
Examples
View
julia> slider(1:5:100)
Arguments
-
Behaviour
-
name::String
- Used to specify the name of the control; Useful if dealing with forms submitted directly to a URL ex.car_id
-
snap::Bool
- Snap on valid values, rather than sliding freely; Suggestion: use with 'step' property -
reverse::Bool
- Work in reverse (changes direction) -
vertical::Bool
- Display in vertical direction -
labelalways::Bool
- Always display the label
-
-
Content
-
label::Bool
- Popup a label when user clicks/taps on the slider thumb and moves it -
markers::Union{Bool, Int}
- Display markers on the track, one for each possible value for the model or using a custom step (when specifying a Number) ex.markers
markers="5"
-
dragrange::Bool
- User can drag range instead of just the two thumbs -
dragonlyrange::Bool
- User can drag only the range instead and NOT the two thumbs
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value ex.0
100
-
-
Labels
-
labelcolorleft::String
- Color name for left label background from the Color Palette ex.primary
teal-10
-
labeltextcolorleft::String
- Color name for left label text from the Color Palette ex.primary
teal-10
-
labelcolorright::String
- Color name for right label background from the Color Palette ex.primary
teal-10
-
labeltextcolorright::String
- Color name for right label text from the Color Palette ex.primary
teal-10
-
labelvalueleft::Union{String, Int}
- Override default label for min value ex.labelvalueleft="model.min + 'px'"
-
labelvalueright::Union{String, Int}
- Override default label for max value ex.labelvalueright="model.max + 'px'"
-
-
Model
-
range::AbstractRange{T}
- The range of values to select from min:step:max, symbols or strings can be used to reference model fields, e.g.range("min":2:"max", :myvalue)
-
lazy::Bool
- If true, update the value of the model field only upon release of the slider
-
-
State
-
disable::Bool
- Put component in disabled mode -
readonly::Bool
- Put component in readonly mode
-
-
Style
-
color::String
- Color name for component from the Color Palette ex.primary
teal-10
-
labelcolor::String
- Color name for component from the Color Palette ex.primary
teal-10
-
thumbpath::String
- Set custom thumb svg path ex.M5 5 h10 v10 h-10 v-10
-
dark::Bool
- Notify the component that the background is a dark color -
dense::Bool
- Dense mode; occupies less space
-
Ratings
#
StippleUI.Ratings.rating
— Function
rating(fieldname::Union{Symbol,Nothing} = nothing,args...; kwargs...)
Rating is a Component which allows users to rate items, usually known as “Star Rating”.
Examples
Model
julia> @vars RatingModel begin
myrating::R{Int} = 3
end
View
julia> rating(:myrating,size="1.5em",icon="thumb_up")
julia> rating(:myrating, size="2em",color="red-7",icon="favorite_border")
julia> rating(:myrating, size="2.5em", color="purple-4", icon="create")
Arguments
-
Behaviour
-
name::String
- Used to specify the name of the control; Useful if dealing with forms submitted directly to a URLcar_id
-
-
Content
-
icon::Union{String, Vector}
- Icon name; make sure you have the icon library installed unless you are using 'img:' prefix; If an array is provided each rating value will use the corresponding icon in the array (0 based) ex.map
ion-add
img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img:path/to/some_image.png
-
iconselected::Union{String, Vector}
- Icon name to be used when selected (optional); make sure you have the icon library installed unless you are using 'img:' prefix; If an array is provided each rating value will use the corresponding icon in the array (0 based) ex.map
ion-add
img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img:path/to/some_image.png
-
iconhalf::Union{String, Vector}
- Icon name to be used when selected (optional); make sure you have the icon library installed unless you are using 'img:' prefix; If an array is provided each rating value will use the corresponding icon in the array (0 based) ex.map
ion-add
img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img:path/to/some_image.png
-
-
Label
-
max::Union{Int, String}
- Number of icons to display ex.3
max="5"
-
-
Model
-
noreset::Bool
- When used, disables default behavior of clicking/tapping on icon which represents current model value to reset model to 0
-
-
State
-
readonly::Bool
- Put component in readonly mode -
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
md
xs
-
color::Union{String, Vector}
- Color name for component from the Color Palette; v1.5.0+: If an array is provided each rating value will use the corresponding color in the array (0 based) ex.primary
primary
teal-10
["accent", "grey-7"]
-
colorselected::Union{String, Vector}
- Color name from the Quasar Palette for selected iconsprimary
teal-10
-
colorhalf::Union{String, Vector}
- Color name from the Color Palette ex.primary
teal-10
-
nodimming::Bool
- Does not lower opacity for unselected icons
-
Scrollareas
#
StippleUI.ScrollAreas.scrollarea
— Method
scrollarea(args...; kwargs...)
The scrollarea
component offers a neat way of customizing the scrollbars by encapsulating your content. Think of it as a DOM element which has overflow: auto
, but with your own custom styled scrollbar instead of browser’s default one and a few nice features on top.
Examples
View
julia> StippleUI.scrollarea(style="height: 200px; max-width: 300px;", [
Html.div("Stipple is a reactive UI library for building interactive
data applications in pure Julia. It uses Genie.jl (on the server side)
and Vue.js (on the client). Stipple uses a high performance MVVM
architecture, which automatically synchronizes the state two-way
(server -> client and client -> server) sending only JSON data over
the wire. The Stipple package provides the fundamental communication
layer, extending Genie's HTML API with a reactive component.")
])
Arguments
-
Behaviour
-
visible::Bool
- Manually control the visibility of the scrollbar; Overrides default mouse over/leave behavior -
delay::Union{Int, String}
- When content changes, the scrollbar appears; this delay defines the amount of time (in milliseconds) before scrollbars disappear again (if component is not hovered) default1000
ex.500
delay!="500
-
horizontal::Bool
- Changes the default axis to horizontal instead of vertical (which is default) for getScrollPosition, getScrollPercentage, setScrollPosition, and setScrollPercentage
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value0
100
-
-
Style
-
dark::Bool
- Notify the component that the background is a dark color -
barstyle::Union{Vector, String, Dict}
- Object with CSS properties and values for custom styling the scrollbars (both vertical and horizontal) ex.barstyle!="{ borderRadius: '5px', background: 'red', opacity: 1 }"
-
contentstyle::Union{Vector, String, Dict}
- Object with CSS properties and values for styling the container ofscrollarea
-
Selects
#
Genie.Renderer.Html.select
— Method
select(fieldname::Symbol, args...; options::Symbol, kwargs...)
Examples
Model
julia> @vars SelectModel begin
model::R{Vector{String}} = []
networks::R{Vector{String}} = ["Google", "Facebook", "Twitter", "Pinterest", "Reddit"]
end
View
julia> select(:model, options= :networks, useinput=true, multiple=true, clearable = true, filled = true, counter = true, usechips = true, label="Social Networks")
Arguments
-
Behaviour
-
name::String
- Used to specify the name of the control; Useful if dealing with forms; If not specified, it takes the value of 'for' prop, if it exists ex.car-id
car-id
-
virtualscrollhorizontal::Bool
- Make virtual list work in horizontal mode -
error::Bool
- Does field have validation errors? -
rules::Vector
- Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rulesrules="[ val => val.length <= 3 || 'Please use maximum 3 characters' ]"
-
reactiverules::Bool
- By default a change in the rules does not trigger a new validation until the model changes; If set to true then a change in the rules will trigger a validation; Has a performance penalty, so use it only when you really need it -
lazyrules::Union{Bool, String}
- If set to boolean true then it checks validation status against the 'rules' only after field loses focus for first time; If set to 'ondemand' then it will trigger only when component’s validate() method is manually called or when the wrapperform
submits itself ex.(Boolean) true
(Boolean) false
ondemand
-
loading::Bool
- Signals the user a process is in progress by displaying a spinner; Spinner can be customized by using the 'loading' slot. -
clearable::Bool
- Appends clearable icon when a value (not undefined or null) is set; When clicked, model becomes null -
autofocus::Bool
- Focus field on initial component render -
for::String
- Used to specify the 'id' of the control and also the 'for' attribute of the label that wraps it; If no 'name' prop is specified, then it is used for this attribute as wellmyFieldsId
-
hidedropdownicon::Bool
- Hide dropdown icon -
fillinput::Bool
- Fills the input with current value; Useful along with 'hideselected'; Does NOT works along with 'multiple' selection -
newvaluemode::String
- Enables creation of new values and defines behavior when a new value is added: 'add' means it adds the value (even if possible duplicate), 'add-unique' adds only unique values, and 'toggle' adds or removes the value (based on if it exists or not already); When using this prop then listening fornewvalue
becomes optional (only to override the behavior defined bynewvaluemode
) ex.add
add-unique
toggle
-
autocomplete::String
- Autocomplete attribute for field ex.autocomplete="country"
-
transitionshow::String
- Transition when showing the menu/dialog; One of embedded transitions ex.fade
slide-down
-
transitionhide::String
- Transition when hiding the menu/dialog; One of embedded transitions ex.fade
slide-down
-
behavior::String
- Overrides the default dynamic mode of showing as menu on desktop and dialog on mobilesdefault
menu
dialog
-
-
Content
-
tablecolspan::Union{Int, String}
- The number of columns in the table (you need this if you use table-layout: fixed) ex.tablecolspan="12"
-
errormessage::String
- Validation error message (gets displayed only if 'error' is set to 'true') ex.Username must have at least 5 characters
-
noerroricon::Bool
- Hide error icon when there is an error -
label::Union{String,Symbol}
- A text label that will “float” up above the input field, once the field gets focus ex.Username
-
stacklabel::Bool
- Label will be always shown above the field regardless of field content (if any) -
hint::String
- Helper (hint) text which gets placed below your wrapped form component ex.Fill in between 3 and 12 characters
-
hidehint::Bool
- Hide the helper (hint) text when field doesn’t have focus -
prefix::String
- Prefix ex.$
-
suffix::String
- Suffix ex.@gmail.com
-
loading::Bool
- Signals the user a process is in progress by displaying a spinner; Spinner can be customized by using the 'loading' slot. -
clearable::Bool
- Appends clearable icon when a value (not undefined or null) is set; When clicked, model becomes null -
clearicon::String
- Custom icon to use for the clear button when using along with 'clearable' attribute ex.close
-
labelslot::Bool
- Enables label slot; You need to set it to force use of the 'label' slot if the 'label' prop is not set -
bottomslots::Bool
- Enables bottom slots ('error', 'hint', 'counter') -
counter::Bool
- Show an automatic counter on bottom right -
dropdownicon::String
- Icon name; ; 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.map
ion-add
img=https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img=path/to/some_image.png
-
useinput::Bool
- Use an input tag where users can type -
inputdebounce::Union{Int, String}
- Debounce the input model update with an amount of milliseconds ex.500
600
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value ex.0
100
-
-
Model
-
multiple::Bool
- Allow multiple selection; Model must be Array -
emitvalue::Bool
- Update model with the value of the selected option instead of the whole option
-
-
Options
-
options::Vector
- Available options that the user can select from. For best performance freeze the list of options ex.options=[ 'BMW', 'Samsung Phone' ]
-
optionvalue::String
- Property of option which holds the 'value'; If using a function then for best performance, reference it from your scope and do not define it inline ex.optionvalue=modelNumber
optionvalue="(item) => item === null ? null : item.modelNumber"
-
optionlabel::Union{String,Symbol}
- Property of option which holds the 'label'; If using a function then for best performance, reference it from your scope and do not define it inline ex.optionlabel=itemName
optionlabel="(item) => item === null ? null : item.itemName"
-
optiondisable::String
- Property of option which tells it’s disabled; The value of the property must be a Boolean; If using a function then for best performance, reference it from your scope and do not define it inline ex.optiondisable=cannotSelect
optiondisable="(item) => item === null ? null : item.cannotSelect"
-
optionsdense::Bool
- Dense mode for options list; occupies less space -
optionsdark::Bool
- Options menu will be colored with a dark color -
optionsselectedclass::String
- CSS class name for options that are active/selected; Set it to an empty string to stop applying the default (which is text-* where * is the 'color' prop value) ex.text-orange
-
optionssanitize::Bool
- Force use of textContent instead of innerHTML to render options; Use it when the options might be unsafe (from user input); Does NOT apply when using 'option' slot! -
optionscover::Bool
- Expanded menu will cover the component (will not work along withuseinput
attribute for obvious reasons) -
menushrink::Bool
- Allow the options list to be narrower than the field (only in menu mode) -
mapoptions::Bool
- Try to map labels of model fromoptions
Vector; has a small performance penalty; If you are using emit-value you will probably need to use map-options to display the label text in the select field rather than the value; Refer to the 'Affecting model' section above
-
-
Position
-
menuanchor::String
- Two values setting the starting position or anchor point of the options list relative to the field (only in menu mode) ex.top left
top middle
top right
top start
top end
center left
center middle
center right
center start
center end
bottom left
bottom middle
bottom right
bottom start
bottom end
-
menuself::String
- Two values setting the options list’s own position relative to its target (only in menu mode) ex.top left
etc -
menuoffset::Vector
- An array of two numbers to offset the options list horizontally and vertically in pixels (only in menu mode) ex.[8, 8]
-
-
Selection
-
multiple::Bool
- Allow multiple selection; Model must be Array -
displayvalue::Union{Int, String}
- Override default selection string, if not usingselected
slot/scoped slot and if not usingusechips
attribute -
displayvaluesanitize::Bool
- Force use of textContent instead of innerHTML to render selected option(s); Use it when the selected option(s) might be unsafe (from user input); Does NOT apply when usingselected
orselecteditem
slots! -
hideselected::Bool
- Hides selection; Use the underlying input tag to hold the label (instead of showing it to the right of the input) of the selected option; Only works for nonmultiple
Selects -
maxvalues::Union{Int, String}
- Allow a maximum number of selections that the user can do ex.5
-
usechips::Bool
- Usechip
component to show what is currently selected
-
-
State
-
disable::Bool
- Put component in disabled mode -
readonly::Bool
- Put component in readonly mode
-
-
Style
-
labelcolor::String
- Color name for the label from the Color Palette; Overrides thecolor
prop; The difference fromcolor
prop is that the label will always have this color, even when field is not focused ex.primary
teal-10
-
color::String
- Color name for component from the Color Palette -
bgcolor::String
- Background color name for component from the Color Palette -
dark::Bool
- Notify the component that the background is a dark color -
filled::Bool
- Usefilled
design for the field -
outlined::Bool
- Useoutlined
design for the field -
borderless::Bool
- Useborderless
design for the field -
standout::Union{Bool, String}
- Use 'standout' design for the field; Specifies classes to be applied when focused (overriding default ones) ex.standout
standout="bg-primary text-white"
-
hidebottomspace::Bool
- Do not reserve space for hint/error/counter anymore when these are not used; As a result, it also disables the animation for those; It also allows the hint/error area to stretch vertically based on its content -
rounded::Bool
- Applies a small standard border-radius for a squared shape of the component -
square::Bool
- Remove border-radius so borders are squared; Overridesrounded
prop/attribute -
dense::Bool
- Dense mode; occupies less space -
itemaligned::Bool
- Match inner content alignment to that ofitem
component -
popupcontentclass::String
- Class definitions to be attributed to the popup content ex.my-special-class
-
popupcontentstyle::Union{Vector, String, Dict}
- Style definitions to be attributed to the popup content ex.background-color: #ff0000
popupcontentstyle!="{ backgroundColor: '#ff0000' }"
-
inputclass::Union{Vector, String, Dict}
- Class definitions to be attributed to the underlying input tag ex.my-special-class
inputclass!="{ 'my-special-class': <condition> }"
-
inputstyle::Union{Vector, String, Dict}
- Style definitions to be attributed to the underlying input tag ex.background-color: #ff0000
inputstyle!="{ backgroundColor: '#ff0000' }"
-
-
Virtual-scroll
-
virtualscrollslicesize::Union{Int, String}
- Minimum number of items to render in the virtual list ex.virtualscrollslicesize="60"
30
-
virtualscrollsliceratiobefore::Union{Int, String}
- Ratio of number of items in visible zone to render before it ex.virtualscrollsliceratiobefore="30"
30
-
virtualscrollsliceratioafter::Union{Int, String}
- Ratio of number of items in visible zone to render after it ex.virtualscrollsliceratioafter="0.3"
-
virtualscrollitemsize::Union{Int, String}
- Default size in pixels (height if vertical, width if horizontal) of an item; This value is used for rendering the initial list; Try to use a value close to the minimum size of an item ex.virtualscrollitemsize="48"
-
virtualscrollstickysizestart::Union{Int, String}
- Size in pixels (height if vertical, width if horizontal) of the sticky part (if using one) at the start of the list; A correct value will improve scroll precision ex.0
virtualscrollstickysizestart="23
-
virtualscrollstickysizeend::Union{Int, String}
- Size in pixels (height if vertical, width if horizontal) of the sticky part (if using one) at the end of the list; A correct value will improve scroll precision ex.0
-
tablecolspan::Union{Int, String}
- The number of columns in the table (you need this if you use table-layout: fixed) ex.tablecolspan="3"
-
Separators
#
StippleUI.Separators.separator
— Method
separator(args...; kwargs...)
The separator
component is used to separate sections of text, other components, etc… It creates a colored line across the width of the parent. It can be horizontal or vertical.
Skeletons
#
StippleUI.Skeletons.skeleton
— Method
skeleton(args...; kwargs...)
The skeleton
is a component for displaying a placeholder preview of your content before you load the actual page data. It’s a nice way of informing the user of what to expect from the page before it is fully loaded and increases the perceived performance. It can be used to incrementally display information on screen as data is being fetched.
Examples
View
julia> skeleton(type="QAvatar")
])
Arguments
-
Content
-
tag::String
- HTML tag to render. Defaults to"div"
. Examples"div"
"span"
-
type::String
- Type of skeleton placeholder. Defaults to"rect"
. Accepted values are"rect"
"circle"
"QBadge"
"QChip"
"QRadio"
etc
-
-
Style
-
dark::Bool
- Whether to use a dark skeleton. -
animation::String
- The animation effect of the skeleton placeholder. Defaults:"wave"
| Examples."pulse"
"fade"
"blink"
"none"
"pulse-x"
-
square::Bool
- Removes border-radius so borders are squared -
bordered::Bool
- Applies a default border to the component -
size::String
- Size in CSS units, including unit name; Overrides 'height' and 'width' props and applies the value to both height and width -
width::String
- Width in CSS units, including unit name; Apply custom width; Use this prop or through CSS; Overridden by 'size' prop if used -
height::String
- Height in CSS units, including unit name; Apply custom height; Use this prop or through CSS; Overridden by 'size' prop if used. Examples"16px"
"2em"
-
Spinners
#
StippleUI.Spinners.spinner
— Function
spinner(spinner_type::Union{String,Symbol} = "", args...; kwargs...)
A spinner
is used to show the user a timely process is currently taking place. It is an important UX feature, which gives the user the feeling the system is continuing to work for longer term activities, like grabbing data from the server or some heavy calculations.
Examples
Model
julia> @vars SpinnerModel begin
box::R{String} = "box"
comment::R{String} = "comment"
hourglass::R{String} = "hourglass"
end
View
julia> spinner(color="primary", size="3em")
julia> spinner(:box, color="orange",size="5.5em")
julia> spinner(:comment, color="green",size="3em")
julia> spinner(:hourglass, color="purple", size="4em")
Arguments
-
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 ex.primary
teal
-
thickness::Int
- Override value to use for stroke-width ex.5
Splitters
#
StippleUI.Splitters.splitter
— Method
splitter(fieldname::Symbol, args...; kwargs...)
Examples
Model
julia> @vars SplitterModel begin
splitterM::R{Int} = 50
end
View
julia> splitter(:splitterM, style="height: 400px", [
template("", "v-slot:before", [
Html.div(class="q-pa-md", [
Html.div("Before", class="text-h4 q-mb-md"),
Html.div("{{ n }}. Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Quis praesentium cumque magnam odio iure quidem, quod illum numquam possimus
obcaecati commodi minima assumenda consectetur culpa fuga nulla ullam. In, libero.",
class = "q-my-md",
@recur(:"n in 20"), key! = "n")
])
]),
template("", "v-slot:after", [
Html.div(class="q-pa-md", [
Html.div("After", class="text-h4 q-mb-md")
Html.div("{{ n }}. Lorem ipsum dolor sit, amet consectetur adipisicing elit.
Quis praesentium cumque magnam odio iure quidem, quod illum numquam possimus
obcaecati commodi minima assumenda consectetur culpa fuga nulla ullam. In, libero.",
class = "q-my-md",
@recur(:"n in 20"), key! = "n")
])
])
])
Arguments
-
Content
-
horizontal::Bool
- Allows the splitter to split its two panels horizontally, instead of vertically -
limits::Vector
- An array of two values representing the minimum and maximum split size of the two panels; When 'px' unit is set then you can use Infinity as the second value to make it unbound on the other side
-
-
Model
-
reverse::Bool
- Apply the model size to the second panel (by default it applies to the first) -
unit::String
- CSS unit for the model -
emitimmediately::Bool
- Emit model while user is panning on the separator -
limits::Vector
- An array of two values representing the minimum and maximum split size of the two panels; When 'px' unit is set then you can use Infinity as the second value to make it unbound on the other side
-
-
State
-
disable::Bool
- Put component in disabled mode
-
-
Style
-
classbefore::Union{Vector,String,Dict}
- Class definitions to be attributed to the 'before' panel ex."bg-deep-orange"
-
classafter::Union{Vector,String,Dict}
- Class definitions to be attributed to the 'after' panel ex."bg-deep-orange"
-
separatorclass::Union{Vector,String,Dict}
- Class definitions to be attributed to the splitter separator ex."bg-deep-orange"
-
separatorstyle::Union{Vector,String,Dict}
- Style definitions to be attributed to the splitter separator ex."border-color: #ff0000;"
-
dark::Bool
- Applies a default lighter color on the separator; To be used when background is darker; Avoid using when you are overriding through separator-class or separator-style props
-
Tables
#
StippleUI.Tables.Column
— Method
Column(name::String, args...)
Examples
julia> Column("x2", align = :right)
Arguments
-
required::Bool
- if we usevisiblecolumns
, this col will always be visible -
label::String
- label for header -
align::Symbol
- alignment for cell -
field::String
- row Object property to determine value for this column ex.name
-
sortable::Bool
- telltable
you want this column sortable
#
StippleUI.Tables.DataTable
— Method
DataTable(data::T, opts::DataTableOptions)
Examples
julia> df = DataFrame(a = sin.(-π:π/10:π), b = cos.(-π:π/10:π), c = string.(rand(21)))
julia> dt = DataTable(df)
or
julia> using TypedTables
julia> t = Table(a = [1, 2, 3], b = [2.0, 4.0, 6.0])
julia> dt = DataTable(t)
or
julia> using Tables
julia> Tables.table([1 2 3; 3 4 5], header = ["a", "b", "c"])
julia> dt = DataTable(t1)
#
StippleUI.Tables.DataTableOptions
— Type
DataTableOptions(addid::Bool, idcolumn::String, columns::Union{Vector{Column},Nothing}, columnspecs::Dict{Union{String, Regex}, Dict{Symbol, Any}})
Examples
julia> DataTableOptions(columns = [Column("x1"), Column("x2", align = :right)])
Columnspecs
Usage for formating columns
julia> import Stipple.opts
julia> df = DataFrame(a = sin.(-π:π/10:π), b = cos.(-π:π/10:π), c = string.(rand(21)))
julia> dt = DataTable(df)
julia> dt.opts.columnspecs[r"^(a|b)$"] = opts(format = jsfunction(raw"(val, row) => `${100*val.toFixed(3)}%`"))
julia> model.table[] = dt
#
StippleUI.Tables.DataTablePagination
— Type
DataTablePagination(sort_by::Symbol, descending::Bool, page::Int, row_per_page::Int)
Examples
julia> DataTablePagination(rows_per_page=50)
#
Genie.Renderer.Html.table
— Method
table(fieldname::Symbol, args...; kwargs...)
Examples
Model
julia> @vars TableModel begin
data::R{DataTable} = DataTable(DataFrame(rand(100000,2), ["x1", "x2"]), DataTableOptions(columns = [Column("x1"), Column("x2", align = :right)]))
data_pagination::DataTablePagination = DataTablePagination(rows_per_page=50)
end
View
julia> table(title="Random numbers", :data; pagination=:data_pagination, style="height: 350px;")
#
StippleUI.Tables.columns
— Method
columns(t::T)::Vector{Column} where {T<:DataTable}
julia> columns = [Column("x1"), Column("x2", align = :right)]
#
StippleUI.Tables.rowselection
— Function
rowselection(dt::DataTable, rows, cols = Colon(), idcolumn = dt.opts.addid ? dt.opts.idcolumn : "__id")
Build a table selection based on row numbers.
Standard behavior of Quasar is to include all columns in the selection.
For large tables it might be sufficient to include only the index, when no other use of the selection value is made. This is achieved by setting cols
to nothing
rowselection(dt, 3) rowselection(dt, 2:5) rowselection(dt, [2, 4, 7]) rowselection(dt, :, nothing)
#
StippleUI.Tables.rowselection
— Function
rowselection(dt::DataTable, idcolumn::Union{String, Symbol}, values, cols = Colon())
Build a table selection based on an index and a value / list of values.
rowselection(dt, "a", [1, 3]) rowselection(dt, "a", 2:9)
#
StippleUI.Tables.rowselection
— Function
rowselection(dt::DataTable, idcolumn::Union{String, Symbol}, f::Function, cols = Colon())
Build a table selection based on a function.
rowselection(dt, "a", iseven) rowselection(dt, "a", x -> x > 3)
#
StippleUI.Tables.rowselection
— Function
rowselection(dt::DataTable, idcolumn::Union{String, Symbol}, regex::Regex, cols = Colon())
Build a table selection based on a Regex.
rowselection(t, "b", r"hello|World")
#
StippleUI.Tables.selectrows!
— Method
selectrows!(model::ReactiveModel, tablefield::Symbol, selectionfield::Symbol = Symbol(tablefield, "_selection"), args...)
selectrows!(dt::R{<:DataTable}, dt_selection::R, args...)
Select table rows of a model based on selection criteria. More information on selection syntax can be found in rowselection
@vars TableDemo begin @mixin table::TableWithPaginationSelection end model = init(TableDemo) model.table[] = DataTable(DataFrame(a = [1, 2, 4, 6, 8, 10], b = ["Hello", "world", ",", "hello", "sun", "!"])) selectrows!(model, :table, [1, 2, 6]) # assumes the existence of a field `:table_selection` selectrows!(model.table, model.table_selection, "b", r"hello|World"i) selectrows!(model, :table, :table_selection, "a", iseven)
Tabpanels
#
StippleUI.TabPanels.tabpanel
— Method
tabpanel(args...; kwargs...)
Tab panels are a way of displaying more information using less window real estate.
Examples
Model
julia>
View
julia>
Arguments
-
General
-
name::Union{Any}
- Panel name
-
-
State
-
disable::Bool
- Put component in disabled mode
-
-
Style
-
dark::Bool
- Notify the component that the background is a dark color
-
#
StippleUI.TabPanels.tabpanelgroup
— Method
tabpanelgroup(args...; kwargs...)
tabpanelgroup
are a way of displaying more information using less window real estate.
Examples
Model
julia> @vars TabPanelModel begin
gpanel::R{String} = "panel"
end
View
julia> Html.div(class="q-pa-md", [
Html.div(class="q-gutter-y-md", style="max-width: 350px", [
tabpanelgroup(:gpanel, animated=true, swipeable=true, infinite=true,
class="bg-purple text-white shadow-2 rounded-borders", [
tabpanel("Lorem ipsum dolor sit amet consectetur
adipisicing elit.", name="mails", [
Html.div("Mails", class="text-h6")
]),
tabpanel("Lorem ipsum dolor sit amet consectetur
adipisicing elit.", name="alarms", [
Html.div("Alarms", class="text-h6")
]),
tabpanel("Lorem ipsum dolor sit amet consectetur
adipisicing elit.", name="movies", [
Html.div("Movies", class="text-h6")
]),
])
])
])
Arguments
-
Behaviour
-
keepalive::Bool
- Equivalent to using Vue’s nativecomponent on the content -
keepaliveinclude::Union{String,Vector}
- Equivalent to using Vue’s native include prop for; Values must be valid Vue component names (e.g. "a,b"
"/a|b/"
['a', 'b']
) -
keepaliveexclude::Union{String,Vector}
- Equivalent to using Vue’s native exclude prop for; Values must be valid Vue component names (e.g. "a,b"
"/a|b/"
['a', 'b']
) -
keepalivemax::Int
- Equivalent to using Vue’s native max prop for(e.g. 2
) -
animated::Bool
- Enable transitions between panel (also see 'transition-prev' and 'transition-next' props) -
infinite::Bool
- Makes component appear as infinite (when reaching last panel, next one will become the first one) -
swipeable::Bool
- Enable swipe events (may interfere with content’s touch/mouse events) -
vertical::Bool
- Default transitions and swipe actions will be on the vertical axis -
transitionprev::String
- One of Quasar’s embedded transitions (has effect only if 'animated' prop is set) (e.g."fade"
"slide-down"
) -
transitionnext::String
- One of Quasar’s embedded transitions (has effect only if 'animated' prop is set) (e.g."fade"
"slide-down"
)
-
Tabs
#
StippleUI.Tabs.tab
— Method
tab(args...; kwargs...)
tabs
are a way of displaying more information using less window real estate.
Examples
View
julia> tab(name="photos", icon="photos", label="Photos")
Arguments
-
Content
-
icon::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). Examples."map"
"ion-add"
"img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg"
"img:path/to/some_image.png"
-
label::Union{Int,String}
- A number or string to label the tab. Example."Home"
-
alert::Union{Bool,String}
- Adds an alert symbol to the tab, notifying the user there are some updates; If its value is not a Boolean, then you can specify a color. Example."alert"
-
nocaps::Bool
- Turns off capitalizing all letters within the tab (which is the default)
-
-
General
-
name::Union{Int,String}
- Panel name. Examples."home"
name! ="1"
-
tabindex::Union{Int,String}
- Tabindex HTML attribute value. Examples.0
100
-
-
State
-
disable::Bool
- Put component in disabled mode
-
-
Style
-
ripple::Union{Bool,Dict}
- Configure material ripple (disable it by setting it to 'false' or supply a config object). Examples.false
"""{"early" => true, "center" => true, "color" => "teal", "keyCodes" => []}"""
-
contentclass::String
- Class definitions to be attributed to the content wrapper."my-special-class"
-
#
StippleUI.Tabs.tabgroup
— Function
tabgroup(fieldname::Union{Symbol,Nothing} = nothing, args...; kwargs...)
The menu
component is a convenient way to show menus. Goes very well with list
as dropdown content, but it’s by no means limited to it.
Examples
Model
julia> @vars TabModel begin
tab_m::R{String} = "tab"
end
View
julia> tabgroup(:tab_m, inlinelabel=true, class="bg-primary text-white shadow-2", [
tab(name="photos", icon="photos", label="Photos"),
tab(name="videos", icon="slow_motion_video", label="Videos"),
tab(name="movies", icon="movie", label="Movies")
])
Arguments
-
Behaviour
-
target::Union{Bool, String}
- Breakpoint (in pixels) of tabs container width at which the tabs automatically turn to a justify alignment. Default.600
| Example.breakpoint! ="500"
-
-
Content
-
vertical::Bool
- Use vertical design (tabs one on top of each other rather than one next to the other horizontally) -
outsidearrows::Bool
- Reserve space for arrows to place them on each side of the tabs (the arrows fade when inactive) -
mobilearrows::Bool
- Force display of arrows (if needed) on mobile -
align::String
- Horizontal alignment the tabs within the tabs container. Default:center
| Accepted Values:left
,center
,right
justify
| Example.right
-
breakpoint::Union{Int, String}
- Breakpoint (in pixels) of tabs container width at which the tabs automatically turn to a justify alignment. Default:600
| Example.breakpoint! = "500"
-
lefticon::String
- The name of an icon to replace the default arrow used to scroll through the tabs to the left, when the tabs extend past the width of the tabs container. Example:arrow_left
-
righticon::String
- The name of an icon to replace the default arrow used to scroll through the tabs to the right, when the tabs extend past the width of the tabs container. Example:arrow_right
-
stretch::Bool
- When used on flexbox parent, tabs will stretch to parent’s height -
shrink::Bool
- By default,tabs
is set to grow to the available space; However, you can reverse that with this prop; Useful (and required) when placing the component in atoolbar
-
switchindicator::Bool
- Switches the indicator position (on left of tab for vertical mode or above the tab for default horizontal mode) -
narrowindicator::Bool
- Allows the indicator to be the same width as the tab’s content (text or icon), instead of the whole width of the tab -
inlinelabel::Bool
- Allows the text to be inline with the icon, should one be used -
nocaps::Bool
- Turns off capitalizing all letters within the tab (which is the default)
-
-
Style
-
activeclass::String
- The class to be set on the active tab -
activecolor::String
- The color to be attributed to the text of the active tab. Examples.teal-10
primary
-
activecolorbg::String
- The color to be attributed to the background of the active tab. Examples.teal-10
primary
-
indicatorcolor::String
- The color to be attributed to the indicator (the underline) of the active tab. Examples.teal-10
primary
-
contentclass::String
- Class definitions to be attributed to the content wrapper -
dense::Bool
- Dense mode; occupies less space
-
Timelines
#
StippleUI.Timelines.timeline
— Method
timeline(args...; kwargs...)
The timeline
component displays a list of events in chronological order. It is typically a graphic design showing a long bar labelled with dates alongside itself and usually events. Timelines can use any time scale, depending on the subject and data.
Examples
View
julia> Html.div(class="q-px-lg q-pb-md", [
timeline(color="secondary", [
timelineentry("Timeline Heading", heading=true),
timelineentry(title="Event Title", subtitle="February 22, 1986", [
Html.div("Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.")
]),
timelineentry(title="Event Title", subtitle="February 21, 1986", icon="delete",[
Html.div("Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.")
]),
timelineentry(title="Event Title",
subtitle="February 22, 1986",
avatar="https://cdn.quasar.dev/img/avatar2.jpg", [
Html.div("Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.")
])
])
])
Arguments
-
Behavior
-
side::String
- Side to place the timeline entries in dense and comfortable layout; For loose layout it gets overridden bytimelineentry
side prop. (default:"right"
) | ex."left"
|"right"
-
layout::String
- Layout of the timeline. Dense keeps content and labels on one side. Comfortable keeps content on one side and labels on the opposite side. Loose puts content on both sides. (default:"dense"
) | ex."comfortable"
|"loose"
|"dense"
-
-
Style
-
color::String
- Color name for component from the Quasar Color Palette. ex."primary"
|"teal-10"
-
dark::Bool
- Notify the component that the background is a dark color
-
#
StippleUI.Timelines.timelineentry
— Method
timelineentry(args...; kwargs...)
Examples
View
julia> timelineentry(title="Event Title", subtitle="February 21, 1986", icon="delete",[
Html.div("Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia
deserunt mollit anim id est laborum.")
])
Arguments
-
Behavior
-
side::String
- Side to place the timeline entry; Works only iftimeline
layout is loose. (default:"right"
) | ex."left"
|"right"
-
-
Content
-
tag::String
- Tag to use, if of type 'heading' only. (default:"h3"
) | ex."h1"
|"h2"
|"h3"
|"h4"
|"h5"
|"h6"
-
heading::Bool
- Defines a heading timeline item -
icon::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."map"
|"ion-add"
) -
avatar::String
- URL to the avatar image; Icon takes precedence if used, so it replaces avatar. -
title::String
- Title of timeline entry; Is overridden if using 'title' slot -
subtitle::String
- Subtitle of timeline entry; Is overridden if using 'subtitle' slot -
body::String
- Body content of timeline entry; Use this prop or the default slot
-
-
Style
-
color::String
- Color name for component from the Quasar Color Palette
-
Toggles
#
StippleUI.Toggles.toggle
— Function
toggle(label::Union{String,Symbol}, fieldname::Union{Symbol,Nothing}, args...; kwargs...)
The toggle
component is another basic element for user input. You can use this for turning settings, features or true/false inputs on and off.
Examples
Model
julia> @vars ToggleModel begin
value::R{Bool} = false
selection::R{Vector{String}} = ["yellow", "red"]
end
View
julia> toggle("Blue", color="blue", :selection, val="blue")
julia> toggle("Yellow", color="yellow", :selection, val="yellow")
julia> toggle("Green", color="green", :selection, val="green")
julia> toggle("Red", color="red", :selection, val="red")
Arguments
-
Behaviour
-
name::String
- Used to specify the name of the control; Useful if dealing with forms submitted directly to a URL ex."car_id"
-
indeterminatevalue::Union{Int, Float64, String, Bool}
- What model value should be considered as 'indeterminate'? default value:null
ex.0
"not_answered"
-
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 -> … default"tf"
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?
-
-
Content
-
icon::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.map
ion-add
img:https://cdn.quasar.dev/logo/svg/quasar-logo.svg
img:path/to/some_image.png
*
-
-
General
-
tabindex::Union{Int, String}
- Tabindex HTML attribute value0
100
-
-
Icons
-
checkedicon::String
- The icon to be used when the toggle is on ex.visibility
-
uncheckedicon::String
- The icon to be used when the toggle is off ex.visibility-off
-
indeterminateicon::String
- The icon to be used when the model is indeterminate ex.help
-
-
Label
-
label::Union{String,Symbol}
- Label to display along the component ex.I agree to terms and conditions
-
leftlabel::Bool
- Label (if any specified) should be displayed on the left side of the component
-
-
Model
-
val::Union{Bool, Int, Float64, String, Vector}
- Works when model ('value') is Array. It tells the component which value should add/remove when ticked/unticked ex.car
-
truevalue::Union{Bool, Int, Float64, String, Vector}
- What model value should be considered as checked/ticked/on? defaulttrue
ex.Agreed
-
falsevalue::Union{Bool, Int, Float64, String, Vector}
- What model value should be considered as unchecked/unticked/off? defaultfalse
ex.Not agreed
-
-
State
-
disabled::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
1.5rem
xs
md
-
color::String
- Color name for component from the Color Palette ex.primary
teal-10
-
dark::Bool
- Notify the component that the background is a dark color -
dense::Bool
- Dense mode; occupies less space -
iconcolor
- Override default icon color (for truthy state only); Color name for component from the Color Palette ex.primary
teal-10
-
Toolbars
#
StippleUI.Toolbars.toolbar
— Method
toolbar(args...; kwargs...)
toolbar
is a component usually part of Layout Header and Footer, but it can be used anywhere on the page.
Examples
View
julia> toolbar(class="text-primary", [
btn(flat=true, round=true, dense=true, icon="menu"),
toolbartitle("Toolbar"),
btn(flat=true, round=true, dense=true, icon="more_vert")
])
Arguments
-
inset::Bool
- Apply an inset to content (useful for subsequent toolbars)
#
StippleUI.Toolbars.toolbartitle
— Method
toolbartitle(args...; kwargs...)
Examples
View
julia> toolbartitle("Menu")
Arguments
-
shrink::Bool
- By default,toolbartitle
is set to grow to the available space. However, you can reverse that with this prop
Tooltips
#
StippleUI.Tooltips.tooltip
— Method
tooltip(args...; kwargs...)
#
StippleUI.Tooltips.tooltip
— Method
tooltip(fieldname::Symbol, args...; kwargs...)
The tooltip
component is to be used when you want to offer the user more information about a certain area in your App. When hovering the mouse over the target element (or quickly tapping on mobile platforms), the tooltip will appear.
Examples
View
julia> btn("Hover me", color="primary", [
tooltip("Some text as content of Tooltip")
])
julia> Html.div(class="inline bg-amber rounded-borders cursor-pointer", style="max-width: 300px", [
Html.div(class="fit flex flex-center text-center non-selectable q-pa-md", "I am groot!<br>(Hover me!)", [
tooltip("I am groot!")
])
julia>
])
Arguments
-
Behaviour
-
transitionshow::String
- Support for inbuilt transitions ex.fade
slide-down
-
transitionhide::String
- Support for inbuilt transitions ex.fade
slide-down
-
scrolltarget::String
- CSS selector or DOM element to be used as a custom scroll container instead of the auto detected one ex.scrolltarget=".scroll-target-class"
scrolltarget="#scroll-target-id"
scrolltarget="body"
-
target::Union{String, Bool}
- Configure a target element to trigger Tooltip toggle; 'true' means it enables the parent DOM element, 'false' means it disables attaching events to any DOM elements; By using a String (CSS selector) it attaches the events to the specified DOM element (if it exists) ex.target=".my-parent"
target!=false
-
noparentevent::Bool
- Skips attaching events to the target DOM element (that trigger the element to get shown) -
delay::Int
- Configure Tooltip to appear with delay. default value.0
ex.delay!="500"
-
hidedelay::Int
- Configure Tooltip to disappear with delay. default value.0
ex.hidedelay!="600"
-
-
Content
-
maxheight::String
- The maximum height of the Tooltip; Size in CSS units, including unit name ex.16px
2rem
-
maxwidth::String
- The maximum width of the Tooltip; Size in CSS units, including unit name ex.16px
2rem
-
-
Position
-
anchor::String
- Two values setting the starting position or anchor point of the Tooltip relative to its target ex.top left
top middle
top right
top start
top end
center left
center middle
center right
center start
center end
bottom left
bottom middle
bottom right
bottom start
bottom end
-
self::String
- Two values setting the Tooltip’s own position relative to its target ex.top left
top middle
top right
top start
top end
center left
center middle
center right
center start
center end
bottom left
bottom middle
bottom right
bottom start
bottom end
-
offset::Vector
- An array of two numbers to offset the Tooltip horizontally and vertically in pixels. default value.[14,14]
ex.[5, 10]
-
-
Style
-
contentclass::Union{Vector, String, Dict}
- Class definitions to be attributed to the content eg.my-special-class
contentclass!="{ 'my-special-class': <condition> }"
-
contentstyle::Union{Vector, String, Dict}
- Style definitions to be attributed to the content eg.background-color: #ff0000
contentstyle!="{ color: '#ff0000' }"
-
Uploaders
#
StippleUI.Uploaders.uploader
— Method
uploader(args...; kwargs...)
Stipple supplies a way for you to upload files through the uploader
component.
Examples
View
julia> uploader(label="Upload Image", autoupload=true, multiple=true, method="POST", url="/upload", field__name="img")
Arguments
-
Behaviour
-
multiple::Bool
- Allow multiple file uploads -
accept::String
- Comma separated list of unique file type specifiers. Maps to 'accept' attribute of native input type=file element ex..jpg, .pdf, image/*
image/jpeg, .pdf
-
capture::String
- Optionally, specify that a new file should be captured, and which device should be used to capture that new media of a type defined by the 'accept' prop. Maps to 'capture' attribute of native input type=file element ex.user
environment
-
maxfilesize::Union{Int, String}
- Maximum size of individual file in bytes ex.1024
1048576
-
maxtotalsize::Union{Int, String}
- Maximum size of all files combined in bytes ex.1024
1048576
-
maxfiles::Union{Int, String}
- Maximum number of files to contain ex.maxfiles!="5"
10
-
filter::Function
- Custom filter for added files; Only files that pass this filter will be added to the queue and uploaded; For best performance, reference it from your scope and do not define it inline ex.filter!="files => files.filter(file => file.size === 1024)"
-
autoupload::Bool
- Upload files immediately when added -
hideuploadbtn::Bool
- Don’t show the upload button
-
-
Content
-
label::Union{String,Symbol}
- Label for the uploader ex.Upload photo here
-
nothumbnails::Bool
- Don’t display thumbnails for image files
-
-
State
-
disable::Bool
- Put component in disabled mode -
readonly::Bool
- Put component in readonly mode
-
-
Style
-
color:String
- Color of the component from the Color Palette eg.primary
teal-10
-
textcolor::String
- Overrides text color (if needed); Color name from the Color Palette eg.primary
teal-10
-
dark::Bool
- Dark mode -
square::Bool
- Removes border-radius so borders are squared -
flat::Bool
- Applies a flat design (no default shadow) -
bordered::Bool
- Applies a default border to the component
-
-
Upload
-
factory::String
- Function which should return an Object or a Promise resolving with an Object; For best performance, reference it from your scope and do not define it inline Function form. (files) => Object, Promise -
url::String
- URL or path to the server which handles the upload. Takes String or factory function, which returns String. Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline ex.+"files ⇒+
https://example.com?count=:({files.length})"
https://example.com/path
-
method::String
- HTTP method to use for upload; Takes String or factory function which returns a String; Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline default.POST
ex.POST
PUT
-
fieldname::String
- Field name for each file upload; This goes into the following header: 'Content-Disposition: form-data; name="HERE"; filename="somefile.png"; If using a function then for best performance, reference it from your scope and do not define it inline default value.(file) => file.name
ex.backgroundFile
fieldname!="(file) => 'background' + file.name"
-
headers::Union{Vector{Dict(String, String)}, String}
- Array or a factory function which returns an array; Array consists of objects with header definitions; Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline ex.[{name: 'Content-Type', value: 'application/json'}, {name: 'Accept', value: 'application/json'}]
-
formfields::Union{Vector{Dict(String, String)}, String}
- Array or a factory function which returns an array; Array consists of objects with additional fields definitions (used by Form to be uploaded); Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline ex.[{name: 'my-field', value: 'my-value'}]
-
with-credentials::Union{Bool, String}
- Sets withCredentials to true on the XHR that manages the upload; Takes boolean or factory function for Boolean; Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline ex.with-credentials
with!="files => ...."
-
sendraw::Union{Bool, String}
- Send raw files without wrapping into a Form(); Takes boolean or factory function for Boolean; Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline ex.sendraw
sendraw!="files => ...."
-
batch::Union{Bool, String}
- Upload files in batch (in one XHR request); Takes boolean or factory function for Boolean; Function is called right before upload; If using a function then for best performance, reference it from your scope and do not define it inline ex."files => files.length > 10"
-
Videos
#
StippleUI.Videos.video
— Function
video(args...; kwargs...)
Using the video
component makes embedding a video like Youtube easy. It also resizes to fit the container by default.
Examples
Model
julia> @vars RadioModel begin
v_ratio::R{String} = "16/9"
end
View
julia> video(src="https://www.youtube.com/embed/dQw4w9WgXcQ")
julia> video(ratio=:v_ratio, src="https://www.youtube.com/embed/k3_tw44QsZQ?rel=0")
Arguments
-
Accessibility
-
title::String
- (Accessibility) Set the native 'title' attribute value of the inner iframe being used
-
-
Behaviour
-
fetchpriority::String
- Provides a hint of the relative priority to use when fetching the iframe document. Default:"auto"
| Accepted values:"auto"
,"high"
,"low"
-
loading::String
- Indicates how the browser should load the iframe. Default:"eager"
| Accepted Values:"eager"
,"lazy"
-
referrerpolicy::String
- Indicates which referrer to send when fetching the frame’s resource. Default:"strict-origin-when-cross-origin"
| Accepted Values:"no-referrer"
,"no-referrer-when-downgrade"
,"origin"
,"origin-when-cross-origin"
,"origin-when-cross-origin"
,"strict-origin"
,"strict-origin-when-cross-origin"
,"unsafe-url"
-
-
Model
-
src::String
- The source url to display in an iframe.
-
-
Style
-
ratio::Union{String,Int,Float64}
- Aspect ratio for the content; If value is a String, then avoid using a computational statement (like '16/9') and instead specify the String value of the result directly (eg. '1.7777')
-