Link Showcase

Sveltekit-UI

Link Preview

Sveltekit-UI

https://www.sveltekit-ui.com

Component Documentation

Component Name

Link

Builder Function Name

create_link_manager

Description

Renders a hyperlink (`<a>`) with optional popover preview. Can handle internal (SvelteKit `goto`) or external links, show a QR, copy link, etc.

Use like example

Config

PropertyTypeDefaultDescription
idstring or null

generated unique ID

A unique string ID for this link.

hrefstring

The URL to navigate to. Determines internal vs external link.

display_textstring

The text displayed in the link if no child content is provided.

text_colorCSS color

Color of the link text.

is_show_previewboolean

!is_internal_link

If true, clicking the link opens a popover with a QR code and copy button. If false, no popover is shown.

on_goto_external_linkfunction

Optional callback when user opens an external link.

Methods

MethodDescriptionParametersReturns
init

Sets up popover, QR code manager, copy/goto buttons, etc. Called once with config.

No Params

handle_a_click

Click handler for the `<a>` element. Prevents default and either triggers internal or external link logic.

No Params

open_link

Opens the link via SvelteKit `goto` if internal, or in a new tab if external.

No Params

Returned Properties

PropertyTypeDescription
hrefstring

Current link address.

popover_managerobject

Popover manager for the link preview popover.

copy_link_button_managerobject

Button manager for the 'Copy Link' button in the popover.

goto_link_button_managerobject

Button manager for the 'Open Link In New Tab' button in the popover.

goto_link_same_tab_button_managerobject

Button manager for the 'Open Link In Same Tab' button in the popover.

inline_goto_link_button_managerobject

Button manager displayed inline for direct navigation if `is_show_preview` is false.

qr_managerobject

QR manager for generating the link's QR code preview.

is_internal_linkboolean

Whether `href` starts with '/' (treated as internal).

is_show_previewboolean

Whether the popover preview is shown on click.

icon
Sponsored byContibase