Opaque type that holds all the configuration
Opaque type that holds the current state
Opaque type for internal library messages
Create a new configuration. This takes as RequiredConfig record.
Set the maxium number of items to show
Select.withCutoff 6 configAdd a callback for when the query changes
Select.withOnQuery OnQueryShow results if the input is focused, but the query is empty Default is False. Select.withEmptySearch True config
Transform the input query before performing the search Return Nothing to prevent searching
transform : String -> Maybe String
transform query =
if String.length query < 4 then
Nothing
else
Just query
Select.withTransformQuery transform configUse a multi select instead of a single select
Message to call when removing an individual item. Please note that without this option specified, you will not be able to remove an individual item from MultiSelect mode.
Select.withOnRemoveItem OnRemoveItemAdd classes to the container of selected items
Select.withMultiInputItemContainerClass "bg-white" configAdd styles to the container of selected items
Select.withMultiInputClass "bg-white" configAdd classes to an individual selected item
Select.withMultiInputItemClass "bg-white" configAdd styles to an individual selected item
Select.withMultiInputItemStyles [ ( "padding", "1rem" ) ] configThis is the container that wraps the entire select view
Add classes to the input control
Select.withInputControlClass "control-class" configAdd styles to the input control
Select.withInputControlClass [ ( "background-color", "red" ) ] configThis is the element that wraps the selected item(s) and the input
Add classes to the input wrapper (element that wraps the input and the clear button)
Select.withInputWrapperClass "col-12" configAdd styles to the input wrapper
Select.withInputWrapperStyles [ ( "color", "red" ) ] configSet the ID of the input
Select.withInputId "input-id" configAdd classes to the input
Select.withInputClass "col-12" configAdd styles to the input
Select.withInputStyles [ ( "color", "red" ) ] configAdd a callback for when the input field receives focus
Select.withOnFocus OnFocusRemove the clear button entirely
Select.withClear FalseAdd classes to the clear button
Select.withClearClass "clear" configAdd styles to the clear button
Select.withClearStyles [ ( "width", "2rem" ) ] configAdd classes to the clear SVG icon
Select.withClearSvgClass "clear" configAdd classes to the underline div
Select.withUnderlineClass "underline" configAdd styles to the underline div
Select.withUnderlineStyles [ ( "width", "2rem" ) ] configAdd classes to the items
Select.withItemClass "border-bottom" configAdd styles to the items
Select.withItemStyles [ ( "color", "peru" ) ] configCustom item element HTML
Select.withItemHtml (\i -> Html.li [] [ text i ]) configWhen this is used the original toLabel function in the config is ignored.
Class for the hightlighted tem
Select.withHighlightedItemClass "red" configStyles for the highlighted item
Select.withHighlightedItemStyles [ ( "padding", "1rem" ) ] configAdd classes to the menu
Select.withMenuClass "bg-white" configAdd styles to the menu
Select.withMenuStyles [ ( "padding", "1rem" ) ] configText that will appear when no matches are found
Select.withNotFound "No matches" configClass for the not found message
Select.withNotFoundClass "red" configHide menu when no matches found
Select.withNotFoundShown False configStyles for the not found message
Select.withNotFoundStyles [ ( "padding", "1rem" ) ] configAdd a prompt text to be displayed when no element is selected
Select.withPrompt "Select a movie" configAdd classes to the prompt text (When no item is selected) Select.withPromptClass "prompt" config
Add styles to prompt text
Select.withPromptStyles [ ( "color", "red" ) ] configCreate a new state. You must pass a unique identifier for each select component.
{
...
selectState = Select.newState "select1"
}Return the query string from the current state model
Select.queryFromState model.selectStateRender the view
Select.view
selectConfig
model.selectState
model.items
selectedItems
Required initial configuration