Link
Links allow users to navigate to a specified location. Use href for external URLs or full page reloads, and to for single-page application (SPA) navigation within Deephaven.
Example

Content
The link component accepts other components, such as text and icon, as children.
Variants
Links can have different styles to indicate their purpose.
Over background
Links can be placed over a background to add a visual prominence to the link.
Quiet State
The is_quiet prop makes the link “quiet”. This can be useful when the link and its corresponding styling should not distract users from surrounding content.
SPA Navigation with to
The to prop enables single-page application (SPA) navigation within Deephaven. It is mutually exclusive with href (which triggers a full page reload but can navigate to any URL).
to accepts either a string (parsed for path, query params, and fragment) or a NavigationTarget dict for explicit control.
Note
Deephaven and all custom components share the path. Avoid using routers, the path, path parameters, and navigation in shared components to prevent conflicts. Do not use the route segment /-/ in your application path as it is reserved for internal use by Deephaven.
Navigation Recommendations
- Use
tofor navigation within a Deephaven widget andhreffor external URLs. Do not use both on the same link. - For programmatic navigation triggered by events or side effects, use
use_navigateinstead of a link.
API Reference
A link is used for navigating between locations.
Returns: Element The rendered link element.
| Parameters | Type | Default | Description |
|---|---|---|---|
| *children | Any | The content to display in the link. | |
| variant | Literal['primary', 'secondary', 'over_background'] | None | 'primary' | The background color of the link. |
| is_quiet | bool | None | None | Whether the link should be displayed with a quiet style. |
| auto_focus | bool | None | None | Whether the element should receive focus on render. |
| href | str | None | None | A URL to link to. Triggers a full page reload. Mutually exclusive with to. |
| target | Literal['_self', '_blank', '_parent', '_top'] | None | None | The target window for the link. |
| to | str | NavigationTarget | None | None | The target location for single-page application navigation. Either a plain string (parsed for path, query params, and fragment), or a NavigationTarget dict with path, query_params, fragment, and replace. Defaults to replace=True (replaces history entry). Mutually exclusive with href. |
| rel | str | None | None | The relationship between the linked resource and the current page. |
| ping | str | None | None | A space-separated list of URLs to ping when the link is followed. |
| download | str | None | None | Causes the browser to download the linked URL. |
| href_lang | str | None | None | Hints at the human language of the linked URL. |
| referrer_policy | str | None | None | How much of the referrer to send when following the link. |