pub struct VirtualListProps {
pub items: ItemGenerator,
pub item_count: usize,
pub height_prior: ItemSize,
pub classes: Classes,
pub item_classes: Classes,
}Expand description
Properties for a VirtualList.
Fields§
§items: ItemGeneratorA callback to render individual items. Only invoked for items on screen.
Use VirtualList::item_gen to create an ItemGenerator.
item_count: usizeThe number of items in the list, in total. Items that are not visible on screen take up scroll space and are lazily instantiated when the user scrolls to them later.
height_prior: ItemSizeAn approximate height for items that haven’t been rendered, yet, but should still take up scroll space. After the first render of an item, the height will be adjusted automatically and measured.
Setting this to an inaccurate value will mis-represent the remaining scroll distance, but cause no other ill effects.
classes: ClassesAdditional classes to apply to the scroll list itself.
§Gotcha
The list itself is rendered without a max height or other layout constraints to stay independent of a particular css solution. Use these additional classes to apply additional css to the list.
item_classes: ClassesIndividual items are wrapped in a <div> to take their measurements in
a block context. The classes here are applied to each such wrapper.
Usually, you don’t need to supply this property.
Trait Implementations§
Source§impl Debug for VirtualListProps
impl Debug for VirtualListProps
Source§impl PartialEq for VirtualListProps
impl PartialEq for VirtualListProps
Source§impl Properties for VirtualListProps
impl Properties for VirtualListProps
impl StructuralPartialEq for VirtualListProps
Auto Trait Implementations§
impl Freeze for VirtualListProps
impl !RefUnwindSafe for VirtualListProps
impl !Send for VirtualListProps
impl !Sync for VirtualListProps
impl Unpin for VirtualListProps
impl !UnwindSafe for VirtualListProps
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> 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> 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.