Live preview

Interactive example

Loading example…

Usage

Import the component and its manager, then make it your own.

ComponentLink
Managercreate_link_manager

svelte

<script>
  // Import the shared stylesheet once in your application's root layout.
  import "sveltekit-ui/style.css"
  import { Link, create_link_manager } from "sveltekit-ui"

  const manager = create_link_manager({
    href: "https://svelte.dev",
    display_text: "Svelte documentation",
    is_show_preview: true,
  })
</script>

<Link {manager} />

API reference

Configure the manager, call its methods, and read its reactive state.

6 entries in configuration

PropertyTypeDefaultDescription
idstring or null generated unique IDA unique string ID for this link.
hrefstring nullThe URL to navigate to. Determines internal vs external link.
display_textstring nullThe text displayed in the link if no child content is provided.
text_colorCSS color nullColor of the link text.
is_show_previewboolean !is_internal_linkIf true, clicking the link opens a popover with a QR code and copy button. If false, no popover is shown.
on_goto_external_linkfunction nullOptional callback when user opens an external link.