Test a web component
Web components hide their internals in a shadow root. document.querySelector stops at that boundary, so a plain CSS selector cannot see inside one.
<my-card></my-card><!-- shadow root: <p>shadow text</p><button id="b">Save</button> -->vibium find css "my-card p"# Error: timeout after 30s waiting for 'css=my-card p': element not foundUse a pierce combinator instead. Full syntax in the selector reference.
Reach inside a component
Section titled “Reach inside a component”>> crosses one shadow boundary:
vibium find css "my-card >> p"# → @e1 [p] "shadow text"const p = await vibe.find({ css: 'my-card >> p' });p = vibe.find(css="my-card >> p")Element p = vibe.find(new SelectorOptions().css("my-card >> p"));Everything works on the result, not just find:
vibium fill "my-card >> input" "hello"vibium click "my-card >> button"vibium text "my-card >> p"vibium is visible "my-card >> button"Reach through nested components
Section titled “Reach through nested components”Component libraries nest hosts inside hosts. >>> searches any depth below the host, so you do not have to name every level:
# <my-card> contains <nested-el>, which has its own shadow rootvibium find css "my-card >>> #deep"Chain them when you want to be explicit about the path:
vibium find css "app-shell >> side-nav >> button"Mix them when only part of the path is known — outer >>> mid >> button searches deeply for mid, then takes exactly one hop into it.
See what a component exposes
Section titled “See what a component exposes”vibium map traverses shadow roots on its own — no combinator needed. It is the fastest way to find out what a component actually renders:
vibium go https://example.com/component-pagevibium map# @e1 [input]# @e2 [button] "Save"# @e3 [button] "Deep Button"Scope it to one component with --selector, which accepts combinators too:
vibium map --selector "my-card >> .content"Don’t know the structure?
Section titled “Don’t know the structure?”Ask the page directly, then write the selector:
vibium eval "document.querySelector('my-card').shadowRoot.innerHTML"When it doesn’t work
Section titled “When it doesn’t work”attachShadow({ mode: 'closed' }) — closed roots are unreachable by design. Nothing in the browser can query them, vibium included. Test through the component’s public API (attributes, properties, events) instead.
The element is there but the click fails — check vibium is visible "my-card >> button" first. If the component renders behind an overlay, that is a real obscured element, not a shadow problem.
A selector with > stopped working — > (CSS child) and >> (pierce) are different. div > p is still an ordinary child selector; only >> and >>> hop boundaries.
Slotted content — elements passed into a component with <slot> stay in the light DOM. Select them normally, without a combinator:
<my-card><span>slotted</span></my-card>vibium find css "my-card span" # works — not in the shadow rootRelated
Section titled “Related”- Selector reference — full syntax
- Actionability — what is checked before a click