hyperbole-0.5.0: Interactive HTML apps using type-safe serverside Haskell
Safe HaskellNone
LanguageGHC2021

Web.Hyperbole.HyperView.Input

Synopsis

Documentation

button :: ViewAction (Action id) => Action id -> View id () -> View id () Source #

<button> HTML tag which sends the action when pressed

#EMBED  ExamplePageSimple.hs messageView

dropdown :: ViewAction (Action id) => (opt -> Action id) -> opt -> View (Option opt id) () -> View id () Source #

Type-safe dropdown. Sends (opt -> Action id) when selected. The default will be selected.

#EXAMPLE datafilter

#EMBED ExamplePageDataLists/Filter.hs familyDropdown

option :: (ViewAction (Action id), Eq opt, ToParam opt) => opt -> Text -> View (Option opt id) () Source #

An option for a dropdown or select

selected :: Attributable h => Bool -> Attributes h -> Attributes h Source #

sets selected = true if the dropdown predicate returns True

data Option opt (id :: k) Source #

The view context for an option

Constructors

Option 

Fields

search :: ViewAction (Action id) => (Text -> Action id) -> DelayMs -> View id () Source #

A live search field. Set a DelayMs to avoid hitting the server on every keystroke

#EMBED ExamplePageErrors.hs viewSearchUsers

checked :: Attributable a => Bool -> Attributes a -> Attributes a Source #

Set checkbox = checked via the client (VDOM doesn't work)

route :: Route a => a -> View c () -> View c () Source #

A hyperlink to another route

>>> route (User 100) id "View User"
<a href="/user/100">View User</a>