UnreviewedAny data-* attribute is forwarded to the rendered element.
Any aria-* attribute is forwarded to the rendered element.
Optional UnrevieweddisplayLayout model for the host. Sizing, alignment, mask, and shadow properties
stay ordinary className / style CSS on the Box itself.
Optional UnreviewedroundFully-round corners (border-radius: 999px, clamped to the box). Pass a
number (px) or a CSS length string ('1rem') for a custom radius. Omit
for square corners.
Optional UnreviewedgapGap between children, matching the CSS gap property. A number is
pixels; a string is any CSS length or two-value gap ('1rem',
'8px 16px'). Applies while the Box is a flex or grid container.
Optional UnreviewedincludeCSS selector for descendants whose border boxes are included in
measurement.rects when Box measures. Coordinates are relative to this
Box's top-left border edge; matches are in document order. Box reads and
compares matching rects for each measurement event. With observe="scroll",
use throttle when the selector matches many descendants; it also delays
CSS state updates after the initial read.
Optional UnreviewedpaddingInner spacing, matching CSS padding. Numbers are pixels; strings accept
CSS shorthand, percentages, and custom properties. Omission adds no style.
Optional UnreviewedmarginOuter spacing, matching CSS margin. Numbers are pixels; strings accept
CSS shorthand, auto, negative lengths, and custom properties.
Omission adds no style.
Optional UnreviewedobserveOne selection or an array of selections, in any order. 'size' watches width
and height; 'context' watches rendering context; 'overflow' watches
content dimensions and clipping. 'edges' reports which edges hide content;
'scroll' reports offsets, potentially every frame; 'all' selects everything.
Selections are independent: use ['size', 'edges'] to combine them.
A measurement handler implies 'size' when no measurement is selected;
a context handler adds 'context'. Size skips content and scroll observers;
overflow adds content observation; hidden edges and scroll add scroll reads.
Without handlers or fade, omission stays idle.
Optional UnreviewedobserveKeeps measurement events and CSS clipping states current outside the
viewport. Has no effect unless observe or fade selects measurement.
Optional UnreviewedthrottleMinimum interval between measurements, in milliseconds. The initial
measurement runs immediately; a trailing read updates CSS states and
delivers the latest event. Descendant rects are read only for emitted
events. The measurement getter always reads fresh values.
Optional UnreviewedfadeFades out every edge that currently hides clipped content, and drops the fade from an edge once the reader scrolls to it.
Optional UnreviewedfadeDepth of the fade gradient. A number is pixels; a string is any CSS
length.
Optional UnreviewedonFired when a selected measurement field changes. detail.changed contains
fields changed since the previous event; detail.current includes the full
snapshot with matching rects. Rect changes alone do not trigger an event.
Optional UnreviewedonFired after Box's browser and local rendering context changes. detail
contains the changed fields and a full current snapshot.
Optional UnreviewedclassCSS class on the component's root element (merged with the component's own
classes). Use it directly for layout and positioning — grid/flex placement,
margins, alignment — rather than wrapping the component in a <div>/<span>.
Optional UnreviewedstyleInline styles on the component's root element. Set layout/positioning here
(or via className) directly on the component instead of adding a wrapper.
Optional UnreviewedchildrenChild elements. When provided, replaces the component's default label/content.
Optional UnreviewedidHTML id attribute.
Optional UnreviewedtitleHTML title attribute — native browser tooltip on hover.
Optional UnreviewedslotAssigns the element to a named <slot> of a parent web component (e.g.
slot="header" inside a <Card>, slot="footer" inside a <Dialog>).
Optional UnreviewedtabTab order. Set to -1 to skip the element when tabbing.
Optional UnreviewedkeyReact/Preact reconciliation key when rendered inside a list. Consumed by the JSX runtime (not forwarded as a DOM attribute).
JSX props for the observing light-DOM
<a-box>container.