Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

CompareOverlays

Popover in five frameworks

The same example, live in each framework. One core underneath, so they should behave the same.

Back to the Popover docs

Live

React

Loading19.3.1

Loading React…

No event yet

Vue

Loading3.5.44

Loading Vue…

No event yet

Svelte

Loading5.57.3

Loading Svelte…

No event yet

Solid

Loading2.0.0-rc.21

Loading Solid…

No event yet

Angular

Loading22.2.4

Loading Angular…

No event yet

The attributes each framework puts on the open popup, read from the page.

AttributeReactVueSvelteSolidAngular
roleClosedClosedClosedClosedClosed
aria-modalClosedClosedClosedClosedClosed
aria-labelledbyClosedClosedClosedClosedClosed
data-openClosedClosedClosedClosedClosed

Nothing open. Open a tile to fill its column.

Each tile sets modal to false, so five popups can be open at once; that is why aria-modal reads absent.

The same example, in each framework

Each tile above runs this file.

Popover.tsx
import { Popover } from '@hamur/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>
  )
}

Measured, per framework

The frameworks against each other only, on the same machine and the same example.

FrameworkTestsSizeOpenCloseMemory
React99648.8 KiB2.10 ms17.4 ms1.03 MiB
Vue1,40943.9 KiB2.20 ms17.2 ms0.82 MiB
Svelte1,41347.2 KiB2.10 ms17.3 ms0.71 MiB
Solid99447.2 KiB2.20 ms17.3 ms0.67 MiB
Angular87449.2 KiB1.70 ms17.6 ms0.71 MiB

Size is the gzip of the component's entry with core and dom. Open, Close and Memory are medians in Chromium 156 on Apple M3 Max, 35 runs per framework; Memory is what one open and close leaves on the heap. Tests are Popover's passing tests in each framework's suites. [N] is a value not measured yet.

Same props, five spellings

The Popover.Root names in each framework's own syntax.

PropReactVueSvelteSolidAngular
defaultOpendefaultOpendefault-opendefaultOpendefaultOpen[defaultOpen]
openopenopenopenopen[open]
onOpenChangeeventonOpenChange@open-changeonOpenChangeonOpenChange(openChange)
actionsRefactionsRefactions-refactionsRefactionsRef[actionsRef]
defaultTriggerIddefaultTriggerIddefault-trigger-iddefaultTriggerIddefaultTriggerId[defaultTriggerId]
handlehandlehandlehandlehandle[handle]
modalmodalmodalmodalmodal[modal]
onOpenChangeCompleteeventonOpenChangeComplete@open-change-completeonOpenChangeCompleteonOpenChangeComplete(openChangeComplete)
triggerIdtriggerIdtrigger-idtriggerIdtriggerId[triggerId]
childrenchildren#defaultchildrenchildrenng-content