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 modedisable::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