cv-guidance-anchor
Lightweight semantic anchor wrapper for product guidance registration.
cv-guidance-anchor is a registration primitive only. It does not render guidance UI, own guidance progress, compute eligibility, or import app-layer guidance models. The wrapper host itself is the registered target element.
Usage
Minimal registration markup:
Anatomy
<cv-guidance-anchor> (host)
└── <slot>Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
anchor-id | String | "" | Stable semantic identifier for the UI action or area. |
surface | String | "" | Product surface where the anchor is available. |
owner | String | "" | Owning feature or team metadata. |
Slots
| Slot | Description |
|---|---|
(default) | Action or content visually associated with anchor |
CSS Parts
None.
CSS Custom Properties
None. cv-guidance-anchor is a light wrapper with display: contents by default.
Visual States
| Host selector | Description |
|---|---|
:host | Uses display: contents for wrapper layout. |
:host([hidden]) | Hides the wrapper and its slotted content. |
Events
| Event | When | Detail |
|---|---|---|
guidance-anchor-register | On connect and semantic update | {anchorId, surface, owner, element} |
guidance-anchor-unregister | On disconnect | {anchorId, surface, owner, element} |
Both events bubble and are composed so an app-level guidance host can observe anchors across shadow boundaries. detail.element is always the cv-guidance-anchor host.
Behavior
- Re-dispatches
guidance-anchor-registerwhenanchor-id,surface, orownerchanges. - Does not query slotted children, child shadow roots, global document selectors, translated text, or coordinates.
- Complex components whose real target is inside Shadow DOM should dispatch the same events manually with the actual
HTMLElement.