DepartureDatePicker instead of group.
name and selector are required. See Schema reference for the full field list, including description, source, memory, properties, tags, privacy, and watch.
Selectors
selector accepts a single CSS selector string or an array of strings:
The data-component convention
The recommended pattern is to render a data-component="<Name>" attribute on the root element of each named component, then select on that attribute:
data-component is the recommended convention.
Children are scoped
Selectors insidechildren are evaluated within their parent’s matched subtree instead of against the whole document. Two card components can therefore each contain a child selected by button.primary without colliding.
Scoping inside views vs at file level
Components at the file root are global and match on every view. Components nested inside a view apply only to that view. Both forms are additive, except that a view-scoped$ref subsumes a global component with the same name. See Views for the full rule.
Referencing shared components
When a component such as a site header, persistent footer, or chat widget appears across views, acomponents: array can contain a reference object instead of another inline definition:
$ref entries in its children: expand recursively. Names resolve against a registry built from the root-level components: arrays of all loaded files; nested children and view-scoped definitions are not addressable. For duplicate registry names, the first definition in source-file path order wins. Implementations SHOULD emit a merge-collision-component warning.
.sightmap/components.yaml
.sightmap/views/plp.yaml
$ref for reuse and attestation:
- Reuse. Update the header’s selector or memory entries in one definition; every referencing view receives the change.
- Attestation. A view’s
components:lists what it expects to contain. Drift-detection tools can report an attested component that matches zero elements separately from a component the view never referenced.
- A
$refentry MUST contain exactly one key ($ref); overrides are not allowed in v1. - A
$refto a name that isn’t in the registry is aref-unresolvederror. - A self-referential chain (
A→B→A) is aref-circularerror. - When a view-scoped
$refand a file-root global share a name, the view-scoped expansion subsumes the global for that view — implementations MUST NOT produce two matches.
Properties
A component can declareproperties: — named values pulled from its matched element and shown alongside the name in enriched snapshots, so an agent sees not just what matched but what state it is in:
name (the annotation key) and an extract object: a from source and, where the source needs one, a path. A component reads its own node (dom.text, dom.raw_text, dom.attr, dom.state) or a descendant component (component, component.exists), so values resolve over the component tree, offline as well as live. pattern refines any value with a regex, and join collects every match of a component path. A value that comes back empty is dropped silently. See the schema reference and SEP-0017.
Tags
tags is an open-vocabulary list of classification labels, such as defect or checkout, separate from the component’s name. Where name answers “what is this,” tags answers “does this belong to a classification I care about.”
SubmitButton above resolves name: SubmitButton and tags: [defect], inherited from the tagged form. Views, requests, messages, and signals carry tags with the same union rule; see the schema reference.
Privacy
privacy tells a capture consumer (anything that records the page for replay or analysis) whether it may retain the matched element’s content:
tags uses: two privacy values are a contradiction to decide, not labels to merge. The usual shape is a mask on a form with an unmask on the one field inside it that is safe to keep.
Rules worth knowing before you add the field:
- Omission declares nothing. A component with no
privacyleaves the consumer’s own default unchanged, so you can adopt the field one component at a time. - The corpus is a floor. A consumer may withhold more than the corpus asks, never less.
unmaskdoes not override a consumer’s own policy. - Properties are governed too, at the node each value is read from. A property that reads a blocked or masked node is dropped, exactly as if it had not resolved.
component.existsanddom.statemay still resolve undermask, because they report structure and state rather than content.sightmap validatewarnsextract-privacy-withheldon a property its own component’sprivacywould withhold. class,style, andidsurvivemask, because replay needs them to render. If one of them carries user data, useblock.
privacy takes no part in matching or identity. See the schema reference and SEP-0009.
Watch
watch: true asks a capture consumer to report when the component becomes visible to the user, not only when someone interacts with it. Empty states, error banners, and promotions are often the components nobody clicks, so a record of interactions alone has no trace of them.
watchapplies to the component it is declared on and never to its children. Covering a subtree would multiply records, so it is the opposite ofprivacy.- A visibility report is passive. Consumers must not treat it as an interaction.
- A consumer’s “is this interactive?” filter must not suppress a watched component.
watch: falseis the same as omitting the field.watchandprivacycompose: a component can be watched and blocked, reporting that it appeared while retaining none of its content.