Skip to content

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

CompareOverlays

Tooltip in five frameworks

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

Back to the Tooltip 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.

The same example, in each framework

Each tile above runs this file.

Tooltip.tsx
import { Tooltip } from '@hamur/react/tooltip'

export default function TooltipExample() {
  return (
    <Tooltip.Provider>
      <Tooltip.Root>
        <Tooltip.Trigger className="button" aria-label="Bold">
          B
        </Tooltip.Trigger>
        <Tooltip.Portal>
          <Tooltip.Positioner sideOffset={8}>
            <Tooltip.Popup className="tooltip">
              <Tooltip.Arrow className="arrow" />
              Bold
            </Tooltip.Popup>
          </Tooltip.Positioner>
        </Tooltip.Portal>
      </Tooltip.Root>
    </Tooltip.Provider>
  )
}

Measured, per framework

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

FrameworkTestsSizeOpenCloseMemory
React66041.3 KiB1.90 ms17.3 ms1.07 MiB
Vue97737.2 KiB1.90 ms17.3 ms0.66 MiB
Svelte98540.5 KiB1.90 ms17.2 ms0.60 MiB
Solid67239.9 KiB1.90 ms17.4 ms0.59 MiB
Angular58842.0 KiB1.50 ms17.4 ms0.63 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 Tooltip's passing tests in each framework's suites. [N] is a value not measured yet.

Same props, five spellings

The Tooltip.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]
onOpenChangeCompleteeventonOpenChangeComplete@open-change-completeonOpenChangeCompleteonOpenChangeComplete(openChangeComplete)
triggerIdtriggerIdtrigger-idtriggerIdtriggerId[triggerId]
trackCursorAxistrackCursorAxistrack-cursor-axistrackCursorAxistrackCursorAxis[trackCursorAxis]
disableddisableddisableddisableddisabled[disabled]
disableHoverablePopupdisableHoverablePopupdisable-hoverable-popupdisableHoverablePopupdisableHoverablePopup[disableHoverablePopup]
childrenchildren#defaultchildrenchildrenng-content