Function slack_blocks::blox::text_input[][src]

pub fn text_input() -> TextInputBuilderInit<'static>
This is supported on crate feature blox only.
Expand description

elems::TextInput - <text_input>

Build a elems::TextInput

Attributes

AttributeTypeOptionalAvailable as child
action_idString or &str
action_triggerelems::text_input::ActionTrigger
placeholdertext::Plain (<text>), String or &str
initial_valueString or &str
lengthimpl std::ops::RangeBounds over u32
min_lengthu32
max_lengthu32
multilinebool

Example

use slack_blocks::{blox::*, elems::TextInput};

let xml: TextInput = blox! {
  <text_input action_id="name_input"
              multiline=true
              placeholder="Type your name"
              length={1..=1000}
  />
};

let equiv = TextInput::builder().action_id("name_input")
                                .multiline(true)
                                .placeholder("Type your name")
                                .length(1..=1000)
                                .build();

assert_eq!(xml, equiv)