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
Attribute | Type | Optional | Available as child |
---|---|---|---|
action_id | String or &str | ❌ | ❌ |
action_trigger | elems::text_input::ActionTrigger | ✅ | ❌ |
placeholder | text::Plain (<text> ), String or &str | ✅ | ❌ |
initial_value | String or &str | ✅ | ❌ |
length | impl std::ops::RangeBounds over u32 | ✅ | ❌ |
min_length | u32 | ✅ | ❌ |
max_length | u32 | ✅ | ❌ |
multiline | bool | ✅ | ❌ |
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)