Skip to main content

Module link

Module link 

Source
Expand description

Link — a clickable text label rendered as underlined inline text.

Link is Teksilo’s hyperlink control: it responds to tap, Enter, and Space like a Button, but renders as styled underlined text rather than a bordered box. It supports an optional url field (informational — the app decides whether and how to open it), a reactive visited state that shifts the text colour, and all three tooltip tiers (plain / rich / composite).

Keyboard behaviour follows the platform link convention: Space and Enter activate; a bare KeyUp with no preceding KeyDown is ignored (lone-KeyUp guard). The focus ring appears only after keyboard navigation (focus_visible), not after a mouse click.

§Accessibility

Role::Link with the label as the AT name. When url is set it is forwarded to set_url so screen readers can announce the destination. Exposes Action::Click and Action::Focus.

let _w = Link::new(lit!("Open documentation"))
    .url("https://example.com/docs");

§Touch and pen

The pressed state is the framework’s (docs/touch-and-pen.md §7.1), so it survives a slide-off and comes back on re-entry, and a pan claimant winning the press clears it with no release. Following the link lands on the release, as it always did.

A link is text-height, so it can fall under the 24 dp target floor. What carries it is WCAG 2.2 SC 2.5.8’s inline exception — the target’s size is constrained by the line height of the text it is set in — and not the miss-only slop pass, which this module used to claim as well. The pass re-attributes a near miss only where the exact hit’s whole bubble path carries no eligible handler, so it is denied wherever the link sits inside a row that takes presses: a link in a list row, a link in an archived notification. Measured by the target-conformance gate (the teksilo-target-conformance crate): 112 × 17 dp beside a tappable row label and 32 × 17 dp as a notification’s replay action both reach exactly their own 17 dp on the short axis, at all three densities.

Structs§

Link
A clickable text link that renders as underlined inline text.