dioxus_element_plug/components/
descriptions_item.rs1use dioxus::prelude::*;
2
3#[derive(Props, Clone, PartialEq)]
5pub struct DescriptionsItemProps {
6 #[props(default)]
7 pub children: Element,
8
9 pub label: String,
11
12 #[props(default = 1)]
14 pub span: u32,
15
16 #[props(default)]
18 pub label_width: Option<String>,
19
20 #[props(default)]
22 pub class: Option<String>,
23}
24
25#[component]
27pub fn DescriptionsItem(props: DescriptionsItemProps) -> Element {
28 rsx! {
29 td {
30 class: "el-descriptions__label el-descriptions__cell",
31 "{props.label}"
32 }
33 td {
34 class: "el-descriptions__content el-descriptions__cell {props.class.clone().unwrap_or_default()}",
35 {props.children}
36 }
37 }
38}