Voorbeelden
Configuratiewizard
Een wizard met drie stappen, waarbij tabbladen als stapindicator dienen en een voortgangsbalk de positie bijhoudt. Vorige en Doorgaan staan onderaan elk paneel.
Voorbeeld
Europe
United States
Step 1 of 3
Skip this and invite people later from Settings.
Workspace
Acme Inc
Region
Europe
Invites
2 teammates
HTML
<bs:bsui-stack direction="column" gap="4" align="stretch">
<bs:bsui-progress value="2" max="3" label="Step 2 of 3" />
<bs:bsui-tabs defaultValue="team">
<bs:bsui-tabs-list>
<bs:bsui-tabs-trigger value="workspace" title="1. Workspace" />
<bs:bsui-tabs-trigger value="team" title="2. Team" />
<bs:bsui-tabs-trigger value="review" title="3. Review" />
</bs:bsui-tabs-list>
<bs:bsui-tabs-panel value="workspace">
<bs:bsui-stack direction="column" gap="4" align="stretch">
<bs:bsui-field>
<bs:bsui-field-label text="Workspace name" />
<bs:bsui-input name="workspace" defaultValue="Acme Inc" />
</bs:bsui-field>
<bs:bsui-field>
<bs:bsui-field-label text="Region" />
<bs:bsui-select name="wizard_region" defaultValue="eu" placeholder="Pick a region">
<bs:bsui-select-trigger />
<bs:bsui-select-popup>
<bs:bsui-select-option value="eu" label="Europe" />
<bs:bsui-select-option value="us" label="United States" />
</bs:bsui-select-popup>
</bs:bsui-select>
</bs:bsui-field>
<bs:bsui-stack direction="row" gap="2" align="center" justify="space-between">
<bs:bsui-text content="Step 1 of 3" variant="caption" tag="span" />
<bs:bsui-button label="Continue" variant="default" />
</bs:bsui-stack>
</bs:bsui-stack>
</bs:bsui-tabs-panel>
<bs:bsui-tabs-panel value="team">
<bs:bsui-stack direction="column" gap="4" align="stretch">
<bs:bsui-field>
<bs:bsui-field-label text="Invite teammates" />
<bs:bsui-textarea name="invites" rows="3" placeholder="One email per line" />
<bs:bsui-field-description text="Skip this and invite people later from Settings." />
</bs:bsui-field>
<bs:bsui-stack direction="row" gap="2" align="center" justify="space-between">
<bs:bsui-button label="Back" variant="outline" />
<bs:bsui-button label="Continue" variant="default" />
</bs:bsui-stack>
</bs:bsui-stack>
</bs:bsui-tabs-panel>
<bs:bsui-tabs-panel value="review">
<bs:bsui-stack direction="column" gap="3" align="stretch">
<bs:bsui-stack direction="row" gap="3" align="center" justify="space-between">
<bs:bsui-text content="Workspace" variant="muted" tag="span" />
<bs:bsui-text content="Acme Inc" variant="label" tag="span" />
</bs:bsui-stack>
<bs:bsui-stack direction="row" gap="3" align="center" justify="space-between">
<bs:bsui-text content="Region" variant="muted" tag="span" />
<bs:bsui-text content="Europe" variant="label" tag="span" />
</bs:bsui-stack>
<bs:bsui-stack direction="row" gap="3" align="center" justify="space-between">
<bs:bsui-text content="Invites" variant="muted" tag="span" />
<bs:bsui-text content="2 teammates" variant="label" tag="span" />
</bs:bsui-stack>
<bs:bsui-stack direction="row" gap="2" align="center" justify="space-between">
<bs:bsui-button label="Back" variant="outline" />
<bs:bsui-button label="Create workspace" variant="default" />
</bs:bsui-stack>
</bs:bsui-stack>
</bs:bsui-tabs-panel>
</bs:bsui-tabs>
</bs:bsui-stack>Hoe het werkt
De tabbladstore bewaart de actieve stap. De acties Doorgaan en Vorige wijzigen deze, en de voortgangswaarde wordt uit dezelfde context afgeleid. De stappanelen blijven gemonteerd, zodat ingevoerde waarden behouden blijven wanneer u teruggaat.
Elk gedrag op deze pagina is de WordPress Interactivity API: elke component registreert zijn eigen store, initialiseert de status in een servergerenderde context en koppelt gebeurtenissen met directives in de markup hierboven. Er is geen paginaspecifieke JavaScript.