Doc Page
Patterns and Recipes
Reusable patterns for composing primitives into real product flows.
Composition Rule
Compose primitives by preserving each primitive's public contract. A recipe can add layout, data fetching, routing, animation, or product styling, but it should not remove required slots, break ARIA links, or hide state from DOM.
Good recipes look like production code with the contract still visible.
Sources: shared/en/patterns-recipes
Select Inside Popover
Pattern:
- Popover opens a lightweight editor.
- Select content may be portalled.
- Selecting an option closes Select.
- The Popover should not dismiss merely because Select content is outside the Popover DOM subtree.
Important details:
- Keep
aria-controlslinkage intact between Select trigger and content. - Treat controlled portalled content as part of the active interaction boundary.
- Same-value option activation should close Select without firing duplicate value-change semantics.
Sources: shared/en/patterns-recipes
Form-Compatible Select
Use Select when you need custom presentation plus form submission:
- Render a hidden input.
- Keep
name,value,required, anddisabledin sync. - Reflect invalid state on trigger with
aria-invalidanddata-invalidwhere applicable. - Use a visible label or
aria-labelledby.
Do not use a custom Select when a native <select> is sufficient for the product need.
Sources: shared/en/patterns-recipes
Combobox Search
Use Combobox when users need filtering or custom values:
- Keep focus on the input.
- Use
aria-activedescendantfor highlighted option. - Keep option IDs stable across filtering.
- Do not clear committed selection on outside dismiss unless the product explicitly requests that behavior.
- In multiple mode, guard
Backspacechip removal during IME composition.
Sources: shared/en/patterns-recipes
Tooltip For Icon Buttons
Tooltip text should not be the only accessible name for an icon button. The trigger needs its own label:
<button aria-label="Archive" data-ui="tooltip" data-slot="trigger">...</button>The tooltip can add aria-describedby, but it should not replace the button name.
Sources: shared/en/patterns-recipes
Recipe Checklist
- Required slots remain present.
- Public state remains reflected through ARIA and
data-*. - Nested layers close in the correct order.
- Portalled content keeps semantic ownership.
- Form fields submit expected values.
- Keyboard paths are tested before visual polish.
Sources: shared/en/patterns-recipes