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

View Source

Content item structure. Use it to create content items for components with trigger/content patterns:

Examples

Corex.Content.Item.new(%{label: "Lorem", content: "Consectetur adipiscing elit."})

Summary

Functions

Creates a single Content.Item from a map, auto-generating :value if not provided.

Types

t()

@type t() :: %Corex.Content.Item{
  content: String.t(),
  disabled: boolean(),
  label: String.t(),
  meta: map(),
  value: String.t()
}

Functions

new(attrs)

@spec new(map()) :: t()

Creates a single Content.Item from a map, auto-generating :value if not provided.

Raises ArgumentError if attrs is not a map or is missing :label or :content. A unique :value is generated when omitted.