Anchor

@Composable
fun Anchor(href: String, attrs: AttrBuilderContext<HTMLAnchorElement>? = null, openInternalLinksStrategy: OpenLinkStrategy? = null, openExternalLinksStrategy: OpenLinkStrategy? = null, updateHistoryMode: UpdateHistoryMode? = null, content: ContentBuilder<HTMLAnchorElement>? = null)(source)

A special version of the A tag which, when clicked on, will not reload the current page if it's within the same site.

Instead, it will use the Kobweb Router to automatically re-render the content of the page without needing to hit a server.

Parameters

openInternalLinksStrategy

If set, force the behavior of how internal links (links under the site's root) open. If not set, this behavior will default to in place. Note that this behavior may be overridden by the browser based on keyboard/mouse shortcuts.

openExternalLinksStrategy

If set, force the behavior of how external links open (links outside this site's domain). If not set, this behavior will default to in a new tab. Note that this behavior may be overridden by the browser based on keyboard/mouse shortcuts.

updateHistoryMode

If set, follow this behavior when following the link. By default, history will be added when visiting the new location (so you can return back to the current page), but UpdateHistoryMode.REPLACE can be used to create an effect where the new page "takes over" the current page in place.