← Back
Checkbox
[basic]Toggle checkboxes with keyboard navigation
Toggle checkboxes with keyboard navigation
For the full interactive experience:
$ mix raxol.playground
Code
item_rows =
model.items
|> Enum.with_index()
|> Enum.map(fn {item, i} ->
prefix = DemoHelpers.cursor_prefix(i, model.cursor)
mark = if item.checked, do: "[x]", else: "[ ]"
text("#{prefix}#{mark} #{item.label}")
end)