pub fn input_block() -> InputBuilderInit<'static>Available on crate feature
blox only.Expand description
§blocks::Input - <input_block>
Build a blocks::Input
§Attributes
| Attribute | Type | Optional | Available as child |
|---|---|---|---|
label | text::Plain, text::Mrkdwn, or text::Text (<text>) | ❌ | ❌ |
element | impl Into<blocks::input::SupportedElement> | ❌ | ✅ |
block_id | String or &str | ✅ | ❌ |
hint | text::Plain (<text>), String, or &str | ✅ | ❌ |
dispatch_actions | bool | ✅ | ❌ |
optional | bool | ✅ | ❌ |
§Example
use slack_blocks::{blocks::Input, blox::*, elems::TextInput, text};
let xml = blox! {
<input_block label="foo">
<text_input action_id="input" />
</input_block>
};
let equivalent =
Input::builder().label("foo")
.element(TextInput::builder().action_id("input").build())
.build();
assert_eq!(xml, equivalent);