#[non_exhaustive]pub struct SortableListProps {
pub len: usize,
pub render: Callback<usize, Element>,
pub on_sort: EventHandler<SortEvent>,
pub axis: Axis,
pub live_preview: bool,
pub touch_handle: bool,
pub attributes: Vec<Attribute>,
}Expand description
Properties for the SortableList component.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.len: usizeNumber of items.
render: Callback<usize, Element>Renders the item at the given index.
on_sort: EventHandler<SortEvent>Fired when the user drops an item at a new position.
axis: AxisList direction: which axis rows are laid out (and shifted) along.
live_preview: boolOpen a live gap where the drop would land, by translating the rows
in between. Set false for the plain highlight-only behavior.
touch_handle: boolConfine touch/pen drags to a leading grip element instead of the
whole row. The grip carries touch-action: none so the rest of the
row keeps scrolling by finger — use this inside scrollable lists.
Style it via [data-sort-handle].
attributes: Vec<Attribute>Implementations§
Source§impl SortableListProps
impl SortableListProps
Sourcepub fn builder() -> SortableListPropsBuilder<((), (), (), (), (), (), ())>
pub fn builder() -> SortableListPropsBuilder<((), (), (), (), (), (), ())>
Create a builder for building SortableListProps.
On the builder, call .len(...), .render(...), .on_sort(...), .axis(...)(optional), .live_preview(...)(optional), .touch_handle(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of SortableListProps.