A command pallet component.
Contains a current state for a command pallet.
init : (Msg -> msg) -> List ( String, msg ) -> Model msg
Accepts Msg converter function and your commands.
CommandPallet.init CommandPalletMsg
[ ( "Increment", Increment )
, ( "Decrement", Decrement )
, ( "1", Set 1 )
, ( "11", Set 11 )
, ( "123", Set 123 )
, ( "151", Set 151 )
, ( "100", Set 100 )
, ( "101", Set 101 )
, ( "900", Set 900 )
]
inFront : Model msg -> Element.Attribute msg
Attribute
in elm-ui.
Use like below:
layout [ CommandPallet.inFront model.commandPallet ] <|
column [] [ text "your application..." ]
html : Model msg -> Html msg
View function with Html
Types.Msg
Needs to be passed to update
.
update : Msg -> Model msg -> ( Model msg, Platform.Cmd.Cmd msg )
Returns a new Model
and a parent Cmd msg
.
subscriptions : Model msg -> Platform.Sub.Sub msg
Subsciption for startup key, p
.
subscriptionsWithKey : Keyboard.Key.Key -> Model msg -> Platform.Sub.Sub msg
Customizable subsciption for startup key.
Key
type is in SwiftsNamesake/proper-keyboard.
showUpMsg : Msg
Use showUpMsg
in your application and customize command pallet startup.