pub struct MultiSelectProps {Show 14 fields
pub value: Option<Vec<String>>,
pub options: Option<Vec<MultiSelectOption>>,
pub placeholder: Option<String>,
pub disabled: Option<bool>,
pub required: Option<bool>,
pub max_selections: Option<usize>,
pub searchable: Option<bool>,
pub on_change: Option<Callback<Vec<String>>>,
pub on_search: Option<Callback<String>>,
pub on_option_select: Option<Callback<MultiSelectOption>>,
pub on_option_deselect: Option<Callback<MultiSelectOption>>,
pub class: Option<String>,
pub style: Option<String>,
pub children: Option<Box<dyn FnOnce() -> AnyView + Send>>,
}Expand description
Props for the MultiSelect component.
Multi-Select component for selecting multiple options with search functionality
§Required Props
- children:
Option<Children>- Children content
§Optional Props
- value:
Vec<String>- Selected values
- options:
Vec<MultiSelectOption>- Available options
- placeholder:
String- Placeholder text
- disabled:
bool- Whether the component is disabled
- required:
bool- Whether the component is required
- max_selections:
usize- Maximum number of selections allowed
- searchable:
bool- Whether to show search functionality
- on_change:
Callback<Vec<String>>- Callback when selection changes
- on_search:
Callback<String>- Callback when search query changes
- on_option_select:
Callback<MultiSelectOption>- Callback when option is selected
- on_option_deselect:
Callback<MultiSelectOption>- Callback when option is deselected
- class:
String- Additional CSS classes
- style:
String- Inline styles
Fields§
§value: Option<Vec<String>>Selected values
options: Option<Vec<MultiSelectOption>>Available options
placeholder: Option<String>Placeholder text
disabled: Option<bool>Whether the component is disabled
required: Option<bool>Whether the component is required
max_selections: Option<usize>Maximum number of selections allowed
searchable: Option<bool>Whether to show search functionality
on_change: Option<Callback<Vec<String>>>Callback when selection changes
on_search: Option<Callback<String>>Callback when search query changes
on_option_select: Option<Callback<MultiSelectOption>>Callback when option is selected
on_option_deselect: Option<Callback<MultiSelectOption>>Callback when option is deselected
class: Option<String>Additional CSS classes
style: Option<String>Inline styles
children: Option<Box<dyn FnOnce() -> AnyView + Send>>Children content
Implementations§
Source§impl MultiSelectProps
impl MultiSelectProps
Sourcepub fn builder() -> MultiSelectPropsBuilder
pub fn builder() -> MultiSelectPropsBuilder
Create a builder for building MultiSelectProps.
On the builder, call .value(...)(optional), .options(...)(optional), .placeholder(...)(optional), .disabled(...)(optional), .required(...)(optional), .max_selections(...)(optional), .searchable(...)(optional), .on_change(...)(optional), .on_search(...)(optional), .on_option_select(...)(optional), .on_option_deselect(...)(optional), .class(...)(optional), .style(...)(optional), .children(...) to set the values of the fields.
Finally, call .build() to create the instance of MultiSelectProps.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MultiSelectProps
impl !RefUnwindSafe for MultiSelectProps
impl Send for MultiSelectProps
impl !Sync for MultiSelectProps
impl Unpin for MultiSelectProps
impl !UnwindSafe for MultiSelectProps
Blanket Implementations§
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
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 more