React
LoadingonOpenChangeLoading React…
Open one. Five follow. Each tile runs Popover in its own framework and reports the change in its own syntax.
Popover docs: demo, examples and APIonOpenChangeLoading React…
@open-changeLoading Vue…
onOpenChangeLoading Svelte…
(openChange)Loading Angular…
onOpenChangeLoading Solid…
No changes yet. Use any tile.
The attributes on each framework's Popup element, read from the page while it is open. Open a tile to fill its column.
Each tile sets modal to false, so five popups can be open at once without each one shutting out the others.
The showcase example for Popover, as written in each framework. Lines that only React has are marked.
import { Popover } from '@▢▢▢▢/react/popover'
export default function PopoverExample() {
return (
<Popover.Root>
<Popover.Trigger className="button">
Notifications
</Popover.Trigger>
<Popover.Portal>
<Popover.Positioner sideOffset={8}>
<Popover.Popup className="popover">
<Popover.Arrow className="arrow" />
<Popover.Title className="popover-title">
Notifications
</Popover.Title>
<Popover.Description className="muted">
You are all caught up.
</Popover.Description>
</Popover.Popup>
</Popover.Positioner>
</Popover.Portal>
</Popover.Root>
)
}
<script setup lang="ts">
import { Popover } from '@▢▢▢▢/vue/popover'
</script>
<template>
<Popover.Root>
<Popover.Trigger class="button">Notifications</Popover.Trigger>
<Popover.Portal>
<Popover.Positioner :side-offset="8">
<Popover.Popup class="popover">
<Popover.Arrow class="arrow" />
<Popover.Title class="popover-title">Notifications</Popover.Title>
<Popover.Description class="muted"
>You are all caught up.</Popover.Description
>
</Popover.Popup>
</Popover.Positioner>
</Popover.Portal>
</Popover.Root>
</template>
Popover in each framework, side by side. Lower is better for size, time and memory. No outside baseline: the frameworks are compared with each other only.
The Popover.Root props as each framework writes them. A name that differs from React is marked.
onCheckedChange(checked, details), onOpenChange(open, details), onValueChange(value, details).:default-checked, :side-offset). Upstream's callbacks are Vue events with the same arguments: checkedChange(checked, details), openChange(open, details), valueChange(value, details).onCheckedChange(checked, details), onOpenChange(open, details), onValueChange(value, details), with details.cancel(), reason and event. Native event props use Svelte's names (onclick, onkeydown).checked, disabled, nativeButton); boolean inputs also work as bare attributes. Each callback with details is an output named without on: checkedChange, openChange, valueChange.onCheckedChange(checked, details), with details.cancel() and details.event. Native handlers are camelCase (onClick, onKeyDown), as Solid 2 requires.defaultOpenpropdefaultOpendefault-opendefaultOpen[defaultOpen]defaultOpenopenpropopenopenopen[open]openonOpenChangeeventonOpenChange@open-changeonOpenChange(openChange)onOpenChangeactionsRefpropactionsRefactions-refactionsRef[actionsRef]actionsRefdefaultTriggerIdpropdefaultTriggerIddefault-trigger-iddefaultTriggerId[defaultTriggerId]defaultTriggerIdhandleprophandlehandlehandle[handle]handlemodalpropmodalmodalmodal[modal]modalonOpenChangeCompleteeventonOpenChangeComplete@open-change-completeonOpenChangeComplete(openChangeComplete)onOpenChangeCompletetriggerIdproptriggerIdtrigger-idtriggerId[triggerId]triggerIdchildrenpropchildren#defaultchildrenng-contentchildren