React
LoadingLoading React…
No event yet
Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.
CompareOverlays
The same example, live in each framework. One core underneath, so they should behave the same.
Loading React…
No event yet
Loading Vue…
No event yet
Loading Svelte…
No event yet
Loading Solid…
No event yet
Loading Angular…
No event yet
The attributes each framework puts on the open popup, read from the page.
| Attribute | React | Vue | Svelte | Solid | Angular |
|---|---|---|---|---|---|
role | Closed | Closed | Closed | Closed | Closed |
aria-modal | Closed | Closed | Closed | Closed | Closed |
aria-labelledby | Closed | Closed | Closed | Closed | Closed |
data-open | Closed | Closed | Closed | Closed | Closed |
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.
Each tile above runs this file.
import { Drawer } from '@hamur/react/drawer'
export default function DrawerExample() {
return (
<Drawer.Root swipeDirection="right">
<Drawer.Trigger className="button">
Open drawer
</Drawer.Trigger>
<Drawer.Portal>
<Drawer.Backdrop className="backdrop drawer-backdrop" />
<Drawer.Viewport className="drawer-viewport">
<Drawer.Popup className="drawer">
<Drawer.Content>
<Drawer.Title className="dialog-title">
Filters
</Drawer.Title>
<Drawer.Description className="muted">
Narrow the list down. Swipe right or press Esc to close.
</Drawer.Description>
<div className="actions">
<Drawer.Close className="button">
Done
</Drawer.Close>
</div>
</Drawer.Content>
</Drawer.Popup>
</Drawer.Viewport>
</Drawer.Portal>
</Drawer.Root>
)
}
The frameworks against each other only, on the same machine and the same example.
| Framework | Tests | Size | Open | Close | Memory |
|---|---|---|---|---|---|
| React | 579 | 45.7 KiB | 1.90 ms | 2.20 ms | 0.78 MiB |
| Vue | 567 | 41.9 KiB | 1.80 ms | 1.80 ms | 0.64 MiB |
| Svelte | 553 | 44.5 KiB | 2.00 ms | 2.80 ms | 0.51 MiB |
| Solid | 539 | 44.1 KiB | 2.00 ms | 1.50 ms | 0.44 MiB |
| Angular | 513 | 45.8 KiB | 2.00 ms | 17.6 ms | 0.51 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 Drawer's passing tests in each framework's suites. [N] is a value not measured yet.
The Drawer.Root names in each framework's own syntax.
| Prop | React | Vue | Svelte | Solid | Angular |
|---|---|---|---|---|---|
| defaultOpen | defaultOpen | default-open | defaultOpen | defaultOpen | [defaultOpen] |
| open | open | open | open | open | [open] |
| onOpenChangeevent | onOpenChange | @open-change | onOpenChange | onOpenChange | (openChange) |
| snapPoints | snapPoints | snap-points | snapPoints | snapPoints | [snapPoints] |
| defaultSnapPoint | defaultSnapPoint | default-snap-point | defaultSnapPoint | defaultSnapPoint | [defaultSnapPoint] |
| snapPoint | snapPoint | snap-point | snapPoint | snapPoint | [snapPoint] |
| onSnapPointChangeevent | onSnapPointChange | @snap-point-change | onSnapPointChange | onSnapPointChange | (snapPointChange) |
| actionsRef | actionsRef | actions-ref | actionsRef | actionsRef | [actionsRef] |
| defaultTriggerId | defaultTriggerId | default-trigger-id | defaultTriggerId | defaultTriggerId | [defaultTriggerId] |
| disablePointerDismissal | disablePointerDismissal | disable-pointer-dismissal | disablePointerDismissal | disablePointerDismissal | [disablePointerDismissal] |
| handle | handle | handle | handle | handle | [handle] |
| modal | modal | modal | modal | modal | [modal] |
| onOpenChangeCompleteevent | onOpenChangeComplete | @open-change-complete | onOpenChangeComplete | onOpenChangeComplete | (openChangeComplete) |
| snapToSequentialPoints | snapToSequentialPoints | snap-to-sequential-points | snapToSequentialPoints | snapToSequentialPoints | [snapToSequentialPoints] |
| swipeDirection | swipeDirection | swipe-direction | swipeDirection | swipeDirection | [swipeDirection] |
| triggerId | triggerId | trigger-id | triggerId | triggerId | [triggerId] |
| children | children | #default | children | children | ng-content |