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

Function SelectGroupLabel

primitives/src/select/components/group.rs:161–183  ·  view source on GitHub ↗
(props: SelectGroupLabelProps)

Source from the content-addressed store, hash-verified

159/// ```
160#[component]
161pub fn SelectGroupLabel(props: SelectGroupLabelProps) -> Element {
162 let mut ctx: SelectGroupContext = use_context();
163
164 let id = use_unique_id();
165 let id = use_id_or(id, props.id);
166
167 use_effect(move || {
168 ctx.labeled_by.set(Some(id()));
169 });
170
171 let render = use_context::<ListboxContext>().render;
172
173 rsx! {
174 if render () {
175 div {
176 // Set the ID for the label
177 id,
178 ..props.attributes,
179 {props.children}
180 }
181 }
182 }
183}

Callers

nothing calls this directly

Calls 2

use_unique_idFunction · 0.85
use_id_orFunction · 0.85

Tested by

no test coverage detected