Effects JS behaviour

Spotlight tour

Onboarding coachmarks: the page dims with a cut-out around the target and each step sits beside it with next/back/skip; keyboard, scroll into view and focus management.

Real scenarios

The component as it is used in a product — not a specimen grid.

First-run onboarding

Start the tour: the page dims with a cut-out around each target. Arrow keys move between steps, Escape skips, focus returns to the button when it ends.

Projects
Spring campaign

Updated 2 hours ago

Mobile app v2

Updated yesterday

Usage this month

7.2 of 10 GB

Important props

Important props
Prop Type Default What it does
steps array [] Each step: title, body, target (a selector; centred without one) and side.
id string null $dispatch('nx-tour-start', 'id') starts this tour.
open bool false Start right after the page loads.
next · back · skip · done · step-label string 'Next' … Button labels and the counter (":current of :total").

Snippet

<x-nx::spotlight-tour id="welcome" next="بعدی" back="قبلی" skip="رد کردن" done="تمام" step-label="گام :current از :total" :steps="[
    ['target' => '#new-project', 'title' => 'از این‌جا شروع کنید', 'body' => 'نخستین پروژه‌تان را بسازید.'],
    ['target' => '#search', 'title' => 'همه‌چیز را پیدا کنید', 'body' => 'کلید / را بزنید.'],
    ['title' => 'آماده‌اید', 'body' => 'این تور از منوی راهنما دوباره پخش می‌شود.'],
]" x-on:nx-tour-finish="$wire.markOnboarded()" />

<x-nx::button x-data x-on:click="$dispatch('nx-tour-start', 'welcome')">نمایش تور</x-nx::button>