MCPcopy Create free account
hub / github.com/DioxusLabs/dioxus-components / SelectGroup

Function SelectGroup

primitives/src/select/components/group.rs:73–99  ·  view source on GitHub ↗
(props: SelectGroupProps)

Source from the content-addressed store, hash-verified

71/// ```
72#[component]
73pub fn SelectGroup(props: SelectGroupProps) -> Element {
74 let ctx = use_context::<SelectContext>();
75 let disabled = ctx.selectable.disabled.cloned() || props.disabled.cloned();
76
77 let labeled_by = use_signal(|| None);
78
79 use_context_provider(|| SelectGroupContext { labeled_by });
80 let render = use_context::<ListboxContext>().render;
81
82 rsx! {
83 if render() {
84 div {
85 role: "group",
86
87 // ARIA attributes
88 aria_disabled: disabled,
89 aria_labelledby: labeled_by,
90
91 ..props.attributes,
92 {props.children}
93 }
94 } else {
95 // If we are not rendering, still render the children components
96 {props.children}
97 }
98 }
99}
100
101/// The props for the [`SelectGroupLabel`] component
102#[derive(Props, Clone, PartialEq)]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected