pub struct LoadMoreProps {Show 22 fields
pub on_load_more: Option<EventHandler<LoadMoreRequest>>,
pub loading: bool,
pub has_more: bool,
pub error: bool,
pub error_message: Option<String>,
pub item_count: Option<u64>,
pub target: Option<String>,
pub focus_new_items: bool,
pub auto: bool,
pub root_margin: Option<String>,
pub href: Option<String>,
pub label: Option<String>,
pub loading_label: Option<String>,
pub retry_label: Option<String>,
pub done_label: Option<String>,
pub error_label: Option<String>,
pub loaded_label: Option<String>,
pub added_label: SelectionBarCountLabel,
pub locale: String,
pub announce_delay: u64,
pub class: Option<String>,
pub attributes: Vec<Attribute>,
}Expand description
Props for LoadMore.
Fields§
§on_load_more: Option<EventHandler<LoadMoreRequest>>Requests the next page. The app fetches, appends items, and updates loading,
has_more, and error.
loading: boolTrue while the app fetches the next page.
has_more: boolSet to false once the feed has no more items. Defaults to true.
error: boolMarks the last load as failed.
error_message: Option<String>Custom error copy. A non-blank message also marks the last load as failed.
item_count: Option<u64>Number of items currently in the feed. Lumen counts the items added by each load from it (lumen-react counts the feed’s DOM children instead).
target: Option<String>Id of the feed container. On web and desktop it is marked busy while loading, and
focus_new_items focuses its first new child.
focus_new_items: boolMoves focus to the first new item after a load (web and desktop; needs target and
item_count).
auto: boolRequests the next page when the end of the feed scrolls into view (web and desktop). The button stays as a fallback.
root_margin: Option<String>Observer margin for auto. Defaults to 0px 0px 200px 0px.
href: Option<String>Renders the control as a link to the next page, for server-rendered pages without
JavaScript. Activating it still calls on_load_more.
label: Option<String>Button text. Defaults to Load more.
loading_label: Option<String>Button text while loading. Defaults to Loading….
retry_label: Option<String>Button text after an error. Defaults to Try again.
done_label: Option<String>Shown and announced once has_more is false. Defaults to No more items.
error_label: Option<String>Default error copy. Defaults to Could not load more items..
loaded_label: Option<String>Announced after a load when item_count is unset. Defaults to More items loaded.
added_label: SelectionBarCountLabelAnnounced after a load. Defaults to {count} item added / {count} items added.
locale: StringLocale for plural rules and number formatting. Defaults to en.
announce_delay: u64Milliseconds between announcements. Defaults to 150.
class: Option<String>Extra classes appended after the Lumen class.
attributes: Vec<Attribute>Any other <div> or global attribute.
Implementations§
Source§impl LoadMoreProps
impl LoadMoreProps
Sourcepub fn builder() -> LoadMorePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
pub fn builder() -> LoadMorePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Create a builder for building LoadMoreProps.
On the builder, call .on_load_more(...)(optional), .loading(...)(optional), .has_more(...)(optional), .error(...)(optional), .error_message(...)(optional), .item_count(...)(optional), .target(...)(optional), .focus_new_items(...)(optional), .auto(...)(optional), .root_margin(...)(optional), .href(...)(optional), .label(...)(optional), .loading_label(...)(optional), .retry_label(...)(optional), .done_label(...)(optional), .error_label(...)(optional), .loaded_label(...)(optional), .added_label(...)(optional), .locale(...)(optional), .announce_delay(...)(optional), .class(...)(optional), .attributes(...)(optional) to set the values of the fields.
Finally, call .build() to create the instance of LoadMoreProps.
Trait Implementations§
Source§impl Clone for LoadMoreProps
impl Clone for LoadMoreProps
Source§impl PartialEq for LoadMoreProps
impl PartialEq for LoadMoreProps
Source§impl Properties for LoadMorePropswhere
Self: Clone,
impl Properties for LoadMorePropswhere
Self: Clone,
Source§type Builder = LoadMorePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
type Builder = LoadMorePropsBuilder<((), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), (), ())>
Source§fn memoize(&mut self, new: &Self) -> bool
fn memoize(&mut self, new: &Self) -> bool
Source§fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
fn into_vcomponent<M>(
self,
render_fn: impl ComponentFunction<Self, M>,
) -> VComponentwhere
M: 'static,
impl StructuralPartialEq for LoadMoreProps
Auto Trait Implementations§
impl !RefUnwindSafe for LoadMoreProps
impl !Send for LoadMoreProps
impl !Sync for LoadMoreProps
impl !UnwindSafe for LoadMoreProps
impl Forget for LoadMoreProps
impl Freeze for LoadMorePropswhere
&'static UnsyncStorage: Freeze,
NonZero<u64>: Freeze,
&'static Location<'static>: Freeze,
PhantomData<Option<ExternalListenerCallback<LoadMoreRequest, ()>>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Attribute>: Freeze,
impl Move for LoadMoreProps
impl Unpin for LoadMoreProps
impl UnsafeUnpin for LoadMorePropswhere
&'static UnsyncStorage: UnsafeUnpin,
NonZeroU64Inner: UnsafeUnpin,
&'static Location<'static>: UnsafeUnpin,
PhantomData<Option<ExternalListenerCallback<LoadMoreRequest, ()>>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DependencyElement for T
impl<T> ErasedDestructor for Twhere
T: 'static,
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 more