Uncertainty Marker
Trust component
<loquix-uncertainty-marker> wraps a phrase inside generated prose and marks it as something the reader should not take at face value. A tooltip explains why on hover or focus.
Preview
Section titled “Preview”The policy changed in
Hover or tab to a marked phrase to see its tooltip.
import '@loquix/core/define/define-uncertainty-marker';<loquix-uncertainty-marker kind="needs-verification"> around 500 orders</loquix-uncertainty-marker>const marker = document.querySelector('loquix-uncertainty-marker');
marker.addEventListener('loquix-uncertainty-click', (event) => { openVerificationPanel(event.detail.kind, event.detail.reason);});Kinds and variants
Section titled “Kinds and variants”| Kind | Meaning |
|---|---|
unsure |
The model is not confident in this phrase. |
needs-verification |
Plausible, but a human should confirm it. |
speculative |
An extrapolation rather than something sourced. |
| Variant | Appearance |
|---|---|
underline |
Dotted underline under the phrase. |
highlight |
Tinted background behind the phrase. |
icon |
Underline plus a trailing icon. |
Each kind carries a localized default reason. Set reason to replace it with something specific to the claim.
Properties
Section titled “Properties”| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
kind |
kind |
'unsure' | 'needs-verification' | 'speculative' |
'unsure' |
What kind of uncertainty applies. |
variant |
variant |
'underline' | 'highlight' | 'icon' |
'underline' |
How the phrase is marked. |
reason |
reason |
string |
localized | Explicit reason shown in the tooltip. |
Events
Section titled “Events”| Event | Detail | Description |
|---|---|---|
loquix-uncertainty-click |
{ kind, reason? } |
Fired on click, Enter, or Space. |
Content slot
Section titled “Content slot”The default slot holds the phrase being marked. Keep it to the words actually in doubt — marking a whole paragraph tells the reader nothing about which part to check.
Accessibility
Section titled “Accessibility”The slotted text stays the control’s accessible name, and the kind and reason are attached with aria-describedby. A screen reader therefore reads the phrase first and the caveat second, instead of replacing the phrase with the caveat.
The tooltip opens on hover and on focus, and closes on mouse leave, blur, or Escape.
CSS parts
Section titled “CSS parts”| Part | Purpose |
|---|---|
marker |
Wrapper element. |
text |
Container for the slotted text. |
icon |
Trailing icon, in the icon variant only. |
tooltip |
The tooltip element. |
CSS custom properties
Section titled “CSS custom properties”| Variable | Purpose |
|---|---|
--loquix-uncert-unsure-color |
Foreground for the unsure kind. |
--loquix-uncert-unsure-bg |
Highlight background for the unsure kind. |
--loquix-uncert-verify-color |
Foreground for needs-verification. |
--loquix-uncert-verify-bg |
Highlight background for needs-verification. |
--loquix-uncert-spec-color |
Foreground for speculative. |
--loquix-uncert-spec-bg |
Highlight background for speculative. |