Tile UI · SolidJS
CSR · SSR · SSGPopover
An anchored SolidJS popover with focus-aware dismissal and controlled state.
Closed: focus returns to the trigger.
import { createSignal } from 'solid-js';
import { Popover, PopoverContent, PopoverTrigger } from '@tile-ui/solid';
export default function PopoverDemo() {
const [open, setOpen] = createSignal(false);
return (Use Popover for interactive anchored content that participates in natural Tab order and outside dismissal.
Registry install
pnpm dlx shadcn@latest add @tile-ui/popover
Package usage
import { Popover } from '@tile-ui/solid';
<Popover onOpenChange={(open) => console.log(open)}>
<PopoverTrigger>Edit</PopoverTrigger>
<PopoverContent><input aria-label="Title" /><button type="button">Apply</button></PopoverContent>
</Popover>
Highlights
- Anchored positioning and outside dismissal
- Natural Tab order inside interactive content
- Controlled
openandonOpenChangecallbacks
Foundation behavior
This Solid implementation uses native nested primitives and does not expose asChild. Controlled state uses Solid accessors and explicit callbacks such as onOpenChange, onValueChange, or onSearchChange where the family supports them.
Portal content is omitted from the server response and mounted during hydration into the resolved document or nested portal scope. Closed and default-open roots keep deterministic trigger IDs and ARIA relationships without a hydration mismatch.
Keyboard behavior follows the shared Foundation: focus and Tab order, Escape dismissal, arrow-key movement, typeahead, submenu branches, and trigger restoration are applied according to the component role.
Registry dependencies
| Item | Purpose |
|---|---|
popover |
Component source and module styles |
core |
Framework-agnostic logic helpers |
utils |
Shared utility helpers |
styles |
Shared SCSS tokens and globals |
API reference
Popover
| Prop | Type | Default |
|---|---|---|
open |
boolean |
— |
defaultOpen |
boolean |
— |
onOpenChange |
(open: boolean) => void |
— |
triggerId |
string |
— |
contentId |
string |
— |
ref |
CallbackRef<HTMLDivElement> |
— |
PopoverTrigger
| Prop | Type | Default |
|---|---|---|
ref |
CallbackRef<HTMLButtonElement> |
— |
PopoverContent
| Prop | Type | Default |
|---|---|---|
side |
'top' | 'right' | 'bottom' | 'left' |
— |
align |
'start' | 'center' | 'end' |
— |
sideOffset |
number |
— |
container |
Node |
— |
ref |
CallbackRef<HTMLDivElement> |
— |
onEscapeKeyDown |
(event: DismissableLayerEvent<KeyboardEvent>) => void |
— |
onPointerDownOutside |
(event: DismissableLayerEvent<PointerEvent>) => void |
— |
onFocusOutside |
(event: DismissableLayerEvent<FocusEvent>) => void |
— |
onInteractOutside |
(event: DismissableLayerEvent<DismissableLayerOutsideEvent>) => void |
— |