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 above runs this file.
import { AlertDialog } from '@hamur/react/alert-dialog'
export default function AlertDialogExample() {
return (
<AlertDialog.Root>
<AlertDialog.Trigger className="button danger">
Delete project
</AlertDialog.Trigger>
<AlertDialog.Portal>
<AlertDialog.Backdrop className="backdrop" />
<AlertDialog.Popup className="dialog">
<AlertDialog.Title className="dialog-title">
Delete this project?
</AlertDialog.Title>
<AlertDialog.Description className="muted">
All of its files and settings will be removed for everyone.
</AlertDialog.Description>
<div className="actions">
<AlertDialog.Close className="button">
Cancel
</AlertDialog.Close>
<AlertDialog.Close className="button danger">
Delete
</AlertDialog.Close>
</div>
</AlertDialog.Popup>
</AlertDialog.Portal>
</AlertDialog.Root>
)
}
The frameworks against each other only, on the same machine and the same example.
| Framework | Tests | Size | Open | Close | Memory |
|---|---|---|---|---|---|
| React | 117 | 28.5 KiB | 1.30 ms | 1.40 ms | 0.84 MiB |
| Vue | 230 | 24.5 KiB | 1.20 ms | 2.20 ms | 0.62 MiB |
| Svelte | 230 | 27.1 KiB | 1.40 ms | 1.50 ms | 0.48 MiB |
| Solid | 113 | 26.7 KiB | 1.50 ms | 2.00 ms | 0.41 MiB |
| Angular | 119 | 28.7 KiB | 1.30 ms | 17.5 ms | 0.48 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 Alert Dialog's passing tests in each framework's suites. [N] is a value not measured yet.
The AlertDialog.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) |
| actionsRef | actionsRef | actions-ref | actionsRef | actionsRef | [actionsRef] |
| defaultTriggerId | defaultTriggerId | default-trigger-id | defaultTriggerId | defaultTriggerId | [defaultTriggerId] |
| handle | handle | handle | handle | handle | [handle] |
| onOpenChangeCompleteevent | onOpenChangeComplete | @open-change-complete | onOpenChangeComplete | onOpenChangeComplete | (openChangeComplete) |
| triggerId | triggerId | trigger-id | triggerId | triggerId | [triggerId] |
| children | children | #default | children | children | ng-content |