Corex.Content
(Corex v0.1.0-beta.3)
View Source
Content items for components with trigger/content patterns to be used with:
Use Corex.Content.new/1 to build a list of items from maps.
Summary
Functions
Creates a list of Content.Item structs from a list of maps.
Functions
@spec new([map()]) :: [Corex.Content.Item.t()]
Creates a list of Content.Item structs from a list of maps.
Fields
:trigger- (required) Content to display in the trigger:content- (required) Content to display in the content area:value- (optional) Unique identifier:disabled- (optional) Whether the item is disabled, defaults tofalse:meta- (optional) Additional metadata map for the item
Examples
Corex.Content.new([
%{trigger: "Lorem ipsum dolor sit amet", content: "Consectetur adipiscing elit."},
%{value: "duis", trigger: "Duis", content: "Nullam eget vestibulum ligula."},
%{value: "donec", trigger: "Donec", content: "Congue molestie ipsum gravida a.", disabled: true}
])Raises ArgumentError if items is not a list of maps.