BlockBox.BlockElements (blockbox v1.2.1)
Defines generator functions for all block elements.
Link to this section Summary
Functions
Creates an image element.
Link to this section Types
Link to this section Functions
Link to this function
button(text, action_id, opts \\ [])
@spec button( String.t() | BlockBox.CompositionObjects.text_object(), String.t(), keyword() ) :: map()
Creates a button element.
options
Options
Options are not included by default.
:url
- String:value
- String:style
- String:confirm
-BlockBox.CompositionObjects.confirm_object/0
Link to this function
checkboxes(action_id, options, opts \\ [])
@spec checkboxes( String.t(), [BlockBox.CompositionObjects.option_object()], keyword() ) :: map()
Creates a checkbox group element.
options
Options
Options are not included by default.
:initial_options
- list ofBlockBox.CompositionObjects.option_object/0
s, Also included is the ability to pass in a list of integers representing the index of the item you want to select in:options
.:confirm
-BlockBox.CompositionObjects.confirm_object/0
Link to this function
datepicker(action_id, opts \\ [])
Creates a datepicker element.
options
Options
Options are not included by default.
:placeholder
-BlockBox.CompositionObjects.plain_text_object/0
or String:initial_date
- String, "YYYY-MM-DD" format. Put "today" for the current date.:confirm
-BlockBox.CompositionObjects.confirm_object/0
Link to this function
image(image_url, alt_text)
Creates an image element.
Link to this function
plain_text_input(action_id, opts \\ [])
Creates a plain text input element.
options
Options
Options are not included by default.
:placeholder
-BlockBox.CompositionObjects.plain_text_object/0
or String:initial_value
- String:multiline
- boolean:min_length
- non negative integer:max_length
- positive integer
Link to this function
radio_buttons(action_id, options, opts \\ [])
@spec radio_buttons( String.t(), [BlockBox.CompositionObjects.option_object()], keyword() ) :: map()
Creates a radio button group element.
options
Options
Options are not included by default.
:initial_option
-BlockBox.CompositionObjects.option_object/0
or an integer representing the index of the option you want to select:confirm
-BlockBox.CompositionObjects.confirm_object/0