Description
Problem Statement
There seems to be no escape hatch for styling ComplexSelector's popup if you're not using StyleX.
The trigger is fine — className takes ordinary utility classes and works cleanly, no !important, no fighting the library. The popup has no equivalent: contentXstyle is StyleXStyles-typed, and the popup surface (the element painting background, border, radius, width) isn't reachable at all.
The surface is the one that matters, because it decides whether a popup looks like the rest of the app. In an app whose own menus are a 288px panel with a 1px border, the same menu built on ComplexSelector comes out 24px wider with no border — on a dark theme that reads as edgeless against the page.
What I tried:
| Route | Lands on | Worked without StyleX? |
|---|---|---|
className / style |
trigger container | yes |
xstyle |
trigger container | no (StyleX) |
contentXstyle |
content wrapper inside the surface | no (StyleX) |
defineTheme({components: {...}}) |
elements with a stable astryx-* class |
couldn't target it — see below |
| — | popup surface | couldn't reach it |
Evidence of Demand
This hits any non-StyleX consumer styling this component, not just my app.
astryx docs styling presents StyleX, Tailwind, className, and styling-library aliases as four options, and points at className where StyleX isn't in play. The repo ships example-vite, example-nextjs, and example-nextjs-tailwind next to example-nextjs-stylex. So I expected className to be available wherever xstyle is, and the popup has neither.
Peer systems expose the popup surface directly: Radix passes className to Popover.Content, MUI has slotProps.paper, Chakra has PopoverContent as a styled slot, Ant has overlayClassName.
Why Existing Components Don't Cover This
className— merges cleanly, but onto the trigger container. Checked the rendered DOM: the class lands on the trigger, and the popup surface's classes are StyleX-generated only.defineTheme({components: {'complex-selector': ...}})— the route I most wanted, since it keeps styling in the theme. It scopes to elements carrying the component's stable class, but the popup surface's rendered attributes are justrole,aria-modal,aria-label,class— noastryx-*entry to scope to. The Theming table inastryx component ComplexSelectorlistsastryx-complex-selectorandastryx-complex-selector-indicator-icon, with no entry for the popup. The data-attribute selector approach in the styling docs needs a stable class to hang off too, so it's out for the same reason.contentXstyle— StyleX-typed, so closed to this project. It also reaches the wrapper inside the surface rather than the surface itself, so it couldn't add a border to the surface's own box even with StyleX.- Swizzling — copies the component out of the library, which trades the upgrade path for a border.
What I ended up doing: the content pulls itself back out to the surface's edge with a negative margin and paints the border there. It works, but it depends on the surface's internal padding staying what it is today, so I'd rather not keep it.
Rough Approaches Considered
A — a stable class on the popup surface, e.g. astryx-complex-selector-popup, so defineTheme and the documented data-attribute selectors can reach it:
components: {
'complex-selector-popup': {
base: { borderWidth: '1px', borderColor: 'var(--color-border)' },
},
}B — a popupClassName prop, the direct analogue of the className that already covers the trigger:
<ComplexSelector popupClassName="my-panel" ...>C — make the surface fully token-driven, so its border/radius/shadow resolve from theme tokens the host app already sets. Probably closest to "themes control what things look like," though it wouldn't help someone who needs one surface to differ from the rest.
A or C look most consistent with the system's direction. Happy to prototype whichever you prefer — or to close this if there's a route I missed.
Activity
[-][RFC] No styling hook reaches ComplexSelector's popup surface[/-][+][RFC] No non-StyleX escape hatch for ComplexSelector's popup (className covers only the trigger)[/+][-][RFC] No non-StyleX escape hatch for ComplexSelector's popup (className covers only the trigger)[/-][+][RFC] No non-StyleX styling hook for ComplexSelector's popup[/+][-][RFC] No non-StyleX styling hook for ComplexSelector's popup[/-][+][RFC] ComplexSelector's popup can't be styled without StyleX[/+]HelloOjasMutreja commentedon Aug 12, 2026
Confirming the gap and a proposed direction
Checked this against the current source (
usePopover'srenderinpackages/core/src/Popover/usePopover.tsx) before proposing anything.Confirming the finding
The popup surface is this element:
It's correct that there's no route in: no
classNamespread, nothemeProps()call giving it a stableastryx-*class the way the trigger and indicator icon get one.ComplexSelector's owncontentXstyleonly reaches the content div nested inside this surface (confirmed atComplexSelector.tsx:324), not the surfacedivitself, which is entirely internal tousePopover. So every popup built onusePopover(not justComplexSelector) has this gap. It's ausePopoverfix, not aComplexSelector-local one.Proposed direction
A combination of A and B, since they're cheap together and match the trigger's own precedent:
diva stable class viathemeProps('popover-surface', {...})(or similarly scoped per-component name), sodefineThemeand the documented data-attribute selectors can reach it the same wayastryx-complex-selectoralready works for the trigger.classNamethroughusePopover'srender(children, props)(ContextRenderProps) onto that samediv, mirroring howclassNamealready reaches the trigger container, so non-StyleX consumers get the same escape hatch StyleX consumers get viaxstyle.This fixes it once for every
usePopoverconsumer (ComplexSelector, and anything else built on the same popover surface) rather than adding a one-off prop per component. Option C (fully token-driven surface) is a good longer-term direction too, but doesn't help the "this one surface needs to differ" case the report describes, so I'd treat it as complementary rather than a substitute.Happy to open a draft PR for this once the direction's confirmed. This touches a shared primitive (
usePopover) that other components build on, so wanted to check before sending code.nynexman4464 commentedon Aug 27, 2026
Resolved by #4991 and corrected by #5009.
ComplexSelectornow exposesastryx-complex-selector-popupon the painted popup surface; every popover surface also carriesastryx-popover-surface, sodefineThemecan style the background, border, radius, elevation, and padding without StyleX or structural selectors. The corrected target shipped in@astryxdesign/core0.4.1.Closing as completed. Making the layer clearance configurable is a separate API request and does not keep this popup-surface styling gap open.