WlLink
Appearance
Full example
<div class="wl-stack" data-space="md">
<WlLink href="?view=docs" >{{ "Read the documentation" }}</WlLink>
<WlLink href="https://github.com/whitewolf06/legato-ui" external>{{ "Open the repository" }}</WlLink>
</div>Behavior
Full example
<div class="wl-stack" data-space="md">
<WlLink href="?view=docs" >{{ "Read the documentation" }}</WlLink>
<WlLink href="https://github.com/whitewolf06/legato-ui" external>{{ "Open the repository" }}</WlLink>
</div>Native and application links
Use native href links or supply a RouterLink-compatible adapter through WlConfig.
Full example
<script setup lang="ts">
import { WlLink } from "legato-ui";
</script>
<template>
<div class="wl-stack" data-space="md">
<div class="wl-inline" data-space="md">
<WlLink tone="neutral" href="https://legato-ui.ru/">neutral</WlLink>
<WlLink tone="accent" href="https://legato-ui.ru/">accent</WlLink>
<WlLink tone="info" href="https://legato-ui.ru/">info</WlLink>
<WlLink tone="success" href="https://legato-ui.ru/">success</WlLink>
<WlLink tone="warning" href="https://legato-ui.ru/">warning</WlLink>
<WlLink tone="danger" href="https://legato-ui.ru/">danger</WlLink>
</div>
<WlLink href="?view=docs" disabled>{{ "Read the documentation" }}</WlLink>
<WlLink href="https://github.com/whitewolf06/legato-ui" external>{{ "Open the repository" }}</WlLink>
</div>
</template>Props
Types, accepted values and literal defaults come from the public manifest. Inherited settings name their source; “Not set” means no default is declared.
| Prop | Type / values | Default | Purpose |
|---|---|---|---|
href | string | Not set | Native URL. |
to | unknown | Not set | Router location passed unchanged to WlConfig.linkComponent. |
external | boolean | false | Opens a new tab with a safe rel and an accessible hint. |
disabled | boolean | false | — |
active | boolean | false | — |
tone | WlTone | Not set | Semantic color role. |
pt | WlPt< | Not set | — |
Events
| Event | Payload | When emitted |
|---|---|---|
click | [event: MouseEvent] | Emitted for an enabled activation; receives the native MouseEvent. |
Slots
| Slot | Type / values | Content |
|---|---|---|
default | default?(props: { isActive: boolean; href: string | | Link content; scope { isActive, href }. |
Pass-through: pt
Sections WlLink are listed below. Attributes merge in this order: createWlPt() WlConfig.ptpt instance. Class and style merge; the last supplied value takes priority for other attributes.
| Section | DOM | Purpose |
|---|---|---|
root | a | Main element of the component. |
Sections refer to the component DOM. Dotted names identify a configuration group and its section; composite parts use their own pt groups. Global and local attributes merge, with class and style added together.
Keyboard and accessibility
- Use link text that describes the destination; external links include a new-tab hint.
- Use href for native links and the optional app router adapter for location objects.
- Tab focuses enabled links; Enter follows them. Disabled links are removed from sequential focus.
Keyboard and application responsibilities
| Key | Action |
|---|---|
| Tab / Shift+Tab | Move between enabled links, actions and form controls. |
| Enter / Space | Activate native actions; links follow with Enter. |
Provide a meaningful accessible name and connect labels, hints and errors to the focusable element. Check the behavior with your own data and a screen reader.
WAI-ARIA Authoring PracticesIn your application, check keyboard controls, zoom and focus visibility. State labels and required information must be readable in every theme.