pub struct LinkProps {
pub class: Option<String>,
pub active_class: Option<String>,
pub children: Result<VNode, RenderError>,
pub new_tab: bool,
pub onclick: Option<Callback<Event<MouseData>>>,
pub onmounted: Option<Callback<Event<MountedData>>>,
pub onclick_only: bool,
pub rel: Option<String>,
pub to: NavigationTarget,
/* private fields */
}Expand description
The properties for a Link.
Fields§
§class: Option<String>The class attribute for the a tag.
active_class: Option<String>A class to apply to the generate HTML anchor tag if the target route is active.
children: Result<VNode, RenderError>The children to render within the generated HTML anchor tag.
new_tab: boolWhen true, the target route will be opened in a new tab.
This does not change whether the Link is active or not.
onclick: Option<Callback<Event<MouseData>>>The onclick event handler.
onmounted: Option<Callback<Event<MountedData>>>The onmounted event handler. Fired when the element is mounted.
onclick_only: boolWhether the default behavior should be executed if an onclick handler is provided.
rel: Option<String>The rel attribute for the generated HTML anchor tag.
For external as, this defaults to noopener noreferrer.
to: NavigationTargetThe navigation target. Roughly equivalent to the href attribute of an HTML anchor tag.
Implementations§
Source§impl LinkProps
impl LinkProps
Sourcepub fn builder() -> LinkPropsBuilder<((), (), (), (), (), (), (), (), ())>
pub fn builder() -> LinkPropsBuilder<((), (), (), (), (), (), (), (), ())>
Create a builder for building LinkProps.
On the builder, call .class(...)(optional), .active_class(...)(optional), .children(...)(optional), .new_tab(...)(optional), .onclick(...)(optional), .onmounted(...)(optional), .onclick_only(...)(optional), .rel(...)(optional), .to(...) to set the values of the fields.
Finally, call .build() to create the instance of LinkProps.