Blask (/blask/) is a UI component library for Lustre!
It has both styled and unstyled components, so you can be as much in control as you need/want to.
You can see them showcased here: https://loipesmas.github.io/blask
- select
- accordion
- tabs
- combobox
- select
- accordion
- tabs
- switch
- button
- input (text, number, file, etc)
- combobox
gleam add blask
import blask
import blask/styled/select
type LanguageOption {
Gleam
Haskell
Rust
Erlang
}
fn language_to_str(language: LanguageOption) -> String {
case language {
Gleam -> "Gleam"
Haskell -> "Haskell"
Rust -> "Rust"
Erlang -> "Erlang"
}
}
type Model {
Model(language_select_state: select.SelectState(LanguageOption))
}
type Msg {
LanguageSelectStateChange(SelectState(LanguageOption))
}
pub fn view(model: Model) -> Element(msg) {
// somewhere in your view
select(
state: model.language_select_state,
on_state_change: LanguageSelectStateChange,
display: language_to_str,
)
}
Further documentation can be found at https://hexdocs.pm/blask.
gleam run # Run the project
gleam test # Run the tests
gleam shell # Run an Erlang shell