Corex.List.Item (Corex v0.1.0-beta.5)

View Source

One selectable row for Combobox, Listbox, or Select.

Fields

  • :label (required) - visible text
  • :value (optional) - submitted option value; defaults when built through Corex.List.new/1 (item-1, …) or Item.new/1 alone (list-<integer>)
  • :to (optional) - URL or path used for redirect-on-select when the parent has redirect
  • :disabled (optional)
  • :group (optional) - group id for grouped lists
  • :meta (optional) - arbitrary map
  • :redirect (optional) - :href | :patch | :navigate | false; controls navigation kind for this item when the parent has redirect

  • :new_tab (optional) - open redirect target in a new tab

Summary

Functions

Creates a single List.Item with an auto-generated value if not provided.

Types

redirect_mode()

@type redirect_mode() :: :href | :patch | :navigate | false | nil

t()

@type t() :: %Corex.List.Item{
  disabled: boolean(),
  group: String.t() | nil,
  label: String.t(),
  meta: map(),
  new_tab: boolean(),
  redirect: redirect_mode(),
  to: String.t() | nil,
  value: String.t()
}

Functions

new(attrs)

Creates a single List.Item with an auto-generated value if not provided.

Raises ArgumentError if attrs is not a keyword list or map.