Function slack_blocks::blox::checkboxes [−][src]
pub fn checkboxes() -> CheckboxesBuilderInit<'static>
This is supported on crate feature
blox
only.Expand description
elems::Checkboxes
- <checkboxes>
Build a elems::Checkboxes
Attributes
Attribute | Type | Optional | Available as child |
---|---|---|---|
action_id | String or &str | ❌ | ❌ |
option | compose::Opt (<option> )* | ❌ (or options ) | ✅ |
options | Vec of compose::Opt * | ❌ (or option ) | ❌ |
initial_options | Vec of compose::Opt * provided via option or options . | ✅ | ❌ |
confirm | compose::Confirm (<confirm> ) | ✅ | ❌ |
* Options cannot have URL set, option text can be mrkdwn or plain.
Example
use slack_blocks::{blox::*, compose::Opt, elems::Checkboxes}; let xml: Checkboxes = blox! { <checkboxes action_id="chex"> <option value="check_1"> <text kind=plain>"Foo"</text> </option> <option value="check_2"> <text kind=mrkdwn>"Bar"</text> </option> <option value="check_3"> <text kind=plain>"Zoo"</text> </option> </checkboxes> }; let equiv = Checkboxes::builder().action_id("chex") .option(Opt::builder().value("check_1") .text_plain("Foo") .build()) .option(Opt::builder().value("check_2") .text_md("Bar") .build()) .option(Opt::builder().value("check_3") .text_plain("Zoo") .build()) .build(); assert_eq!(xml, equiv)