Destination. Demo uses "#"; real links pass a URL.
variant
NockerlLinkVariant
'default'
Emphasis: cyan accent (default) or subtle/inherit-color (muted).
onAccent
boolean
false
Renders on a cyan accent surface, so text flips to the on-accent token.
visited
boolean
false
Force the visited (already-read) treatment regardless of history: the recede state a real visited link earns via :visited. For docs/showcase + tests.
external
boolean
false
Marks the link as external: adds the ↗ glyph + target/rel + a11y hint.
disabled
boolean
false
Inert + clearly-seen (never invisible) state. aria-disabled, not focusable.
leadingIcon
React.ReactNode
n/a
Optional leading glyph (e.g. a download icon), baseline-aligned.
onClick
() => void
n/a
Click handler (the demo blocks navigation so "#" doesn't jump).
Also accepts the native <a> attributes (e.g. onClick, disabled, id, aria-*, data-*), forwarded straight through, plus a forwarded ref.
Parameter
Type
Default
Description
LinkAnnotation.Url(url) *
String
n/a
The destination, attached over a span via withLink inside buildAnnotatedString.
styles
TextLinkStyles
n/a
Per-state link styling. Nockerl uses SpanStyle(color = accentPrimary, textDecoration = Underline), the cyan brand accent + an underline.
TextLinkStyles.style
SpanStyle?
n/a
Rest style. color = NockerlTheme.colors.accentPrimary; textDecoration = TextDecoration.Underline.
TextLinkStyles.hoveredStyle
SpanStyle?
null
Pointer-hover style (desktop / Chromebook). Android touch has no hover; press is the feedback.
TextLinkStyles.focusedStyle
SpanStyle?
null
Focus style for D-pad / keyboard traversal.
UriHandler
LocalUriHandler
n/a
Ambient handler that opens the tapped URL; supplied by the Compose environment.
LinkInteractionListener
(LinkAnnotation) -> Unit
null
Optional override for click handling instead of the default UriHandler open.
SwiftUI renders links with the standard Link view or markdown inside Text; the
link color comes from the environment tint. There is no shipped Nockerl link
component. These are the intended bindings.
Style
Type
Default
Description
Link(_:destination:)
View
n/a
Standalone link to a URL. Activates via click and full keyboard focus.
.tint(_:)
Color
n/a
The link color. Bound to NockerlTheme.accent (brand cyan), the only link color.
.underline()
Text
n/a
The underline affordance on standalone links (markdown links carry it automatically).
Text("[label](url)")
View
n/a
Inline links inside prose via markdown; the inherited tint colors them.
environment(\.openURL)
OpenURLAction
n/a
Optional override of how a tapped link opens (custom routing instead of the system handler).
Cross-platform drift (tracked for reconciliation)
The treatment is unified (cyan accent + underline); the implementations differ:
No shared link component yet. Web documents the intended @dizyx/nockerl-reactLink; Android has no NockerlLink, so links are markdown-rendered via
TextLinkStyles / LinkAnnotation; Swift/Voice ships no link at all (it opens
system URLs via NSWorkspace). All three should converge on one link spec.
Underline default. Web + Swift underline at rest; the renderer’s TextLinkStyles
on Android should pin TextDecoration.Underline so links never read as plain accent text.
Link color token. Bind every platform to the single accent (accent.primary), with no
per-platform link hue.