pub struct LinkProps {
pub class: Option<String>,
pub active_class: Option<String>,
pub children: Element,
pub new_tab: bool,
pub onclick: Option<EventHandler<MouseEvent>>,
pub onmounted: Option<EventHandler<MountedEvent>>,
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: Element
The children to render within the generated HTML anchor tag.
new_tab: bool
When true
, the target
route will be opened in a new tab.
This does not change whether the Link
is active or not.
onclick: Option<EventHandler<MouseEvent>>
The onclick event handler.
onmounted: Option<EventHandler<MountedEvent>>
The onmounted event handler. Fired when the element is mounted.
onclick_only: bool
Whether 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 a
s, this defaults to noopener noreferrer
.
to: NavigationTarget
The 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
.