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 * as React from 'react'
import { Tour, type TourStep } from '@hamur/react/tour'
interface Copy {
title: string
body: string
}
function XIcon() {
return (
<svg className="tour-icon" viewBox="0 0 16 16" aria-hidden="true">
<path d="M4 4l8 8M12 4l-8 8" />
</svg>
)
}
export default function TourExample() {
const newFile = React.useRef<HTMLButtonElement>(null)
const search = React.useRef<HTMLInputElement>(null)
const settings = React.useRef<HTMLElement>(null)
const steps = React.useMemo<TourStep<Copy>[]>(
() => [
{
id: 'new-file',
target: newFile,
data: { title: 'Create a file', body: 'Start a blank document from the toolbar.' },
},
{
id: 'search',
target: search,
data: { title: 'Find anything', body: 'Search file names and their contents.' },
},
{
id: 'settings',
target: settings,
side: 'top',
data: { title: 'Your settings', body: 'Turn autosave and sharing on or off here.' },
},
],
[],
)
return (
<div className="tour-page">
<div className="tour-toolbar">
<button ref={newFile} type="button" className="button">
New file
</button>
<input
ref={search}
className="input tour-search"
aria-label="Search files"
placeholder="Search files"
/>
</div>
<section ref={settings} className="tour-settings" aria-label="Settings">
<label className="row">
<input type="checkbox" defaultChecked />
Autosave
</label>
<label className="row">
<input type="checkbox" />
Share with my team
</label>
</section>
<Tour.Root steps={steps}>
{({ step }) => (
<>
<Tour.Trigger className="button">
Take the tour
</Tour.Trigger>
<Tour.Portal>
<Tour.Backdrop className="backdrop" />
<Tour.Spotlight className="tour-spotlight" />
<Tour.Positioner className="tour-positioner">
<Tour.Popup className="popover tour-popup">
<Tour.Arrow className="arrow" />
<div className="tour-head">
<Tour.Progress className="tour-progress" />
<Tour.Close className="tour-close" aria-label="Close tour">
<XIcon />
</Tour.Close>
</div>
<Tour.Title className="popover-title">
{step?.data?.title}
</Tour.Title>
<Tour.Description className="muted">
{step?.data?.body}
</Tour.Description>
<div className="tour-footer">
<Tour.Skip className="tour-skip" />
<Tour.Previous className="button" />
<Tour.Next className="button" />
</div>
</Tour.Popup>
</Tour.Positioner>
</Tour.Portal>
</>
)}
</Tour.Root>
</div>
)
}
The frameworks against each other only, on the same machine and the same example.
| Framework | Tests | Size | Open | Close | Memory |
|---|---|---|---|---|---|
| React | Not measured yet | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Vue | 347 | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Svelte | Not measured yet | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Solid | 347 | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
| Angular | 351 | Not measured yet | Not measured yet | Not measured yet | Not measured yet |
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; Memory is what one open and close leaves on the heap. Tests are Tour's passing tests in each framework's suites. [N] is a value not measured yet.
The Tour.Root names in each framework's own syntax.
| Prop | React | Vue | Svelte | Solid | Angular |
|---|---|---|---|---|---|
| steps | steps | steps | steps | steps | [steps] |
| defaultOpen | defaultOpen | default-open | defaultOpen | defaultOpen | [defaultOpen] |
| open | open | open | open | open | [open] |
| onOpenChangeevent | onOpenChange | @open-change | onOpenChange | onOpenChange | (openChange) |
| onOpenChangeCompleteevent | onOpenChangeComplete | @open-change-complete | onOpenChangeComplete | onOpenChangeComplete | (openChangeComplete) |
| step | step | step | step | step | [step] |
| defaultStep | defaultStep | default-step | defaultStep | defaultStep | [defaultStep] |
| onStepChangeevent | onStepChange | @step-change | onStepChange | onStepChange | (stepChange) |
| modal | modal | modal | modal | modal | [modal] |
| disablePointerDismissal | disablePointerDismissal | disable-pointer-dismissal | disablePointerDismissal | disablePointerDismissal | [disablePointerDismissal] |
| disableTargetInteraction | disableTargetInteraction | disable-target-interaction | disableTargetInteraction | disableTargetInteraction | [disableTargetInteraction] |
| keyboardNavigation | keyboardNavigation | keyboard-navigation | keyboardNavigation | keyboardNavigation | [keyboardNavigation] |
| describeTarget | describeTarget | describe-target | describeTarget | describeTarget | [describeTarget] |
| spotlightPadding | spotlightPadding | spotlight-padding | spotlightPadding | spotlightPadding | [spotlightPadding] |
| spotlightRadius | spotlightRadius | spotlight-radius | spotlightRadius | spotlightRadius | [spotlightRadius] |
| targetTimeout | targetTimeout | target-timeout | targetTimeout | targetTimeout | [targetTimeout] |
| missingTarget | missingTarget | missing-target | missingTarget | missingTarget | [missingTarget] |
| labels | labels | labels | labels | labels | [labels] |
| actionsRef | actionsRef | actions-ref | actionsRef | actionsRef | [actionsRef] |
| handle | handle | handle | handle | handle | [handle] |
| children | children | #default | children | children | ng-content |