pub struct GroupProps {
pub children: Children,
pub class: &'static str,
pub style: &'static str,
pub id: &'static str,
pub row: bool,
pub error: bool,
pub aria_label: &'static str,
pub aria_labelledby: &'static str,
pub data_testid: &'static str,
}lep only.Expand description
Props for the Group component.
Groups checkboxes or switch controls with optional horizontal layout.
Renders as <div role="group"> with aria_label or aria_labelledby
to name the group for screen readers.
ยงExamples
use form_rs::leptos::Group;
use leptos::prelude::*;
#[component]
pub fn OptionsGroup() -> impl IntoView {
view! {
<Group aria_label="Notifications" row=true>
<span>"Email"</span>
<span>"SMS"</span>
</Group>
}
}ยงRequired Props
- children:
Children- Controls such as checkboxes or switches.
ยงOptional Props
- class: [
&'static str]- Additional CSS class names.
- style: [
&'static str]- Inline CSS.
- id: [
&'static str]idattribute.
- row:
bool- When
true, renders children horizontally.
- When
- error:
bool- When
true, applies the error modifier class.
- When
- aria_label: [
&'static str]- Accessible label for the group.
- aria_labelledby: [
&'static str]- ID of element that labels the group.
- data_testid: [
&'static str]data-testidfor automated testing.
Fieldsยง
ยงchildren: ChildrenControls such as checkboxes or switches.
class: &'static strAdditional CSS class names.
style: &'static strInline CSS.
id: &'static strid attribute.
row: boolWhen true, renders children horizontally.
error: boolWhen true, applies the error modifier class.
aria_label: &'static strAccessible label for the group.
aria_labelledby: &'static strID of element that labels the group.
data_testid: &'static strdata-testid for automated testing.
Implementationsยง
Sourceยงimpl GroupProps
impl GroupProps
Sourcepub fn builder() -> GroupPropsBuilder<((), (), (), (), (), (), (), (), ())>
pub fn builder() -> GroupPropsBuilder<((), (), (), (), (), (), (), (), ())>
Create a builder for building GroupProps.
On the builder, call .children(...), .class(...)(optional), .style(...)(optional), .id(...)(optional), .row(...)(optional), .error(...)(optional), .aria_label(...)(optional), .aria_labelledby(...)(optional), .data_testid(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of GroupProps.
Trait Implementationsยง
Auto Trait Implementationsยง
impl !RefUnwindSafe for GroupProps
impl !Sync for GroupProps
impl !UnwindSafe for GroupProps
impl Freeze for GroupProps
impl Send for GroupProps
impl Unpin for GroupProps
impl UnsafeUnpin for GroupProps
Blanket Implementationsยง
impl<Token, Builder, How> AllPropsFor<Builder, How> for Tokenwhere
Builder: Buildable<Token>,
<Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> HasAllProps<(), T> for T
Sourceยงimpl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Sourceยงfn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Sourceยงimpl<T> Instrument for T
impl<T> Instrument for T
Sourceยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
Sourceยงfn in_current_span(self) -> Instrumented<Self> โ
fn in_current_span(self) -> Instrumented<Self> โ
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
Sourceยงfn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
self to a value of a Properties struct.Sourceยงimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
Sourceยงfn into_prop_value(self) -> T
fn into_prop_value(self) -> T
self to a value of a Properties struct.