Function freya_components::Link
source · pub fn Link<'a>(__props: LinkProps) -> Element
Expand description
Similar to Link
, but you can use it in Freya.
Both internal routes (dioxus-router) and external links are supported. When using internal routes
make sure the Link is descendant of a Router
component.
Styling
Inherits the LinkTheme
theme.
Example
With Dioxus Router:
rsx! {
Link {
to: AppRouter::Settings,
label { "App Settings" }
}
}
With external routes:
rsx! {
Link {
to: "https://crates.io/crates/freya",
label { "Freya crates.io" }
}
}
Props
For details, see the props struct definition.
to
:IntoRoutable
The route or external URL string to navigate to.
children
:Element
Inner children for the Link.
onerror
:Option<EventHandler<()>>
This event will be fired if opening an external link fails.
tooltip
:Option<LinkTooltip>
A little text hint to show when hovering over the anchor.
Setting this to
None
is the same asLinkTooltip::Default
. To remove the tooltip, set this toLinkTooltip::None
.