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
endView
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.mapion-addimg:https://cdn.quasar.dev/logo/svg/quasar-logo.svgimg:path/to/some_image.pngiconselected::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.mapion-addimg:https://cdn.quasar.dev/logo/svg/quasar-logo.svgimg:path/to/some_image.pngiconhalf::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.mapion-addimg:https://cdn.quasar.dev/logo/svg/quasar-logo.svgimg:path/to/some_image.png
- Label
max::Union{Int, String}- Number of icons to display ex.3max="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.16px2remmdxscolor::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.primaryprimaryteal-10["accent", "grey-7"]colorselected::Union{String, Vector}- Color name from the Quasar Palette for selected iconsprimaryteal-10colorhalf::Union{String, Vector}- Color name from the Color Palette ex.primaryteal-10nodimming::Bool- Does not lower opacity for unselected icons