React
LoadingonOpenChangeLoading React…
Open one. Five follow. Each tile runs Alert Dialog in its own framework and reports the change in its own syntax.
Alert Dialog 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.
The showcase example for Alert Dialog, as written in each framework. Lines that only React has are marked.
import { AlertDialog } from '@▢▢▢▢/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>
)
}
<script setup lang="ts">
import { AlertDialog } from '@▢▢▢▢/vue/alert-dialog'
</script>
<template>
<AlertDialog.Root>
<AlertDialog.Trigger class="button danger"
>Delete project</AlertDialog.Trigger
>
<AlertDialog.Portal>
<AlertDialog.Backdrop class="backdrop" />
<AlertDialog.Popup class="dialog">
<AlertDialog.Title class="dialog-title"
>Delete this project?</AlertDialog.Title
>
<AlertDialog.Description class="muted">
All of its files and settings will be removed for everyone.
</AlertDialog.Description>
<div class="actions">
<AlertDialog.Close class="button">Cancel</AlertDialog.Close>
<AlertDialog.Close class="button danger">Delete</AlertDialog.Close>
</div>
</AlertDialog.Popup>
</AlertDialog.Portal>
</AlertDialog.Root>
</template>
Alert Dialog 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 AlertDialog.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]handleonOpenChangeCompleteeventonOpenChangeComplete@open-change-completeonOpenChangeComplete(openChangeComplete)onOpenChangeCompletetriggerIdproptriggerIdtrigger-idtriggerId[triggerId]triggerIdchildrenpropchildren#defaultchildrenng-contentchildren