pub struct SortableListProps {
pub len: usize,
pub render: Callback<usize, Element>,
pub on_sort: EventHandler<SortEvent>,
pub axis: Axis,
pub live_preview: bool,
pub transition_ms: u32,
pub overlay: Option<Callback<usize, Element>>,
pub touch_handle: bool,
pub handle: Option<Callback<usize, Element>>,
pub attributes: Vec<Attribute>,
}Expand description
Properties for the SortableList component.
Fields§
§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.
transition_ms: u32Duration (ms) of the row-slide transition during live preview.
overlay: Option<Callback<usize, Element>>Opt-in floating ghost: renders overlay(index) pinned to the pointer
while dragging, and hides the picked-up row in place so its slot reads
as the drop gap. Absent → the row itself slides. Keep the ghost
lightweight; it is your content, not a clone of the row.
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].
handle: Option<Callback<usize, Element>>Content for the touch_handle grip, keyed by index. Defaults to a
braille-dots glyph when unset.
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), .transition_ms(...)(optional), .overlay(...)(optional), .touch_handle(...)(optional), .handle(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of SortableListProps.