Corex.List.Item (Corex v0.1.0-alpha.29)

View Source

List item structure.

Use it to create flat lists of selectable items for:

Fields

  • :id - (optional) Unique identifier, auto-generated if not provided
  • :label - (required) Display text
  • :disabled - (optional) Whether the item is disabled
  • :group - (optional) Group identifier for grouping items
  • :meta - (optional) Additional metadata for the item
  • :redirect - (optional) When top-level redirect is true, set to false on an item to disable redirect for that item
  • :new_tab - (optional) When redirect is used, set to true to open this item's URL in a new tab

Summary

Functions

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

Types

t()

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

Functions

new(attrs)

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

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