Tour Callout
One stop of a product tour: the explained element and a callout with the step, a sentence and buttons. Placing it on the real element is a port contract.
Install
npx ui8kit add tour-calloutPulls in: block, button, compose, group, kit-box, kit-button, kit-text, section-frame, stack, text, utils
Preview
Add your first block
Step 2 of 4
Add your first block
Pick a block from the list and it appears on the page.
Code
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework svelte --dir src --registry-url https://registry.buildy.tw/svelte --strict-cdnnpx ui8kit add tour-callout<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the
position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target),
tone, density.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
export type TourCalloutProps = {
id: string;
title: string;
text: string;
target: string;
position: string;
skip: string;
next: string;
placement?: "below" | "above" | "end";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Block from "../compose/Block.svelte";
import Button from "../compose/Button.svelte";
import Group from "../compose/Group.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import SectionFrame from "../components/section-frame.svelte";
import { cn } from "../utils";
let {
id,
title,
text,
target,
position,
skip,
next,
placement = "below",
tone = "default",
density = "default",
landmarkLabel,
}: TourCalloutProps = $props();
</script>
<SectionFrame id={id} title={title} tone={tone} density={density} landmarkLabel={landmarkLabel}>
<Block
tag="div"
class={cn(
"flex gap-4",
(
(placement as string) === "end" ? "flex-col items-start md:flex-row md:items-center"
: (placement as string) === "above" ? "flex-col-reverse items-start"
: "flex-col items-start"
)
)}
data-placement={placement}
data-slot="tour"
>
<Button variant="outline" size="default" type="button" class="inset-ring-foreground">
{target}
</Button>
<Stack
gap="4"
align="stretch"
class={cn("w-full max-w-sm", "rounded bg-card inset-ring inset-ring-border", "p-4", "shadow-md")}
role="group"
aria-label={title}
data-slot="tour-callout"
>
<Text size="xs" class="text-muted-foreground">
{position}
</Text>
<Text size="base" weight="semibold">
{title}
</Text>
<Text size="sm" class="text-muted-foreground">
{text}
</Text>
<Group gap="2" justify="end">
<Button variant="ghost" size="sm" type="button">
{skip}
</Button>
<Button variant="default" size="sm" type="button">
{next}
</Button>
</Group>
</Stack>
</Block>
</SectionFrame>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework react --dir src --registry-url https://registry.buildy.tw/react --strict-cdnnpx ui8kit add tour-callout// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the
* position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target),
* tone, density.
*/
import { type ReactNode } from "react";
import { Block, Button, Group, Stack, Text } from "../compose";
import { SectionFrame } from "../components/section-frame";
import { cn } from "../utils";
export type TourCalloutProps = {
id: string;
title: string;
text: string;
target: string;
position: string;
skip: string;
next: string;
placement?: "below" | "above" | "end";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
export function TourCallout({
id,
title,
text,
target,
position,
skip,
next,
placement = "below",
tone = "default",
density = "default",
landmarkLabel,
}: TourCalloutProps) {
return (
<SectionFrame id={id} title={title} tone={tone} density={density} landmarkLabel={landmarkLabel}>
<Block
tag="div"
className={cn(
"flex gap-4",
(
(placement as string) === "end" ? "flex-col items-start md:flex-row md:items-center"
: (placement as string) === "above" ? "flex-col-reverse items-start"
: "flex-col items-start"
)
)}
data-placement={placement}
data-slot="tour"
>
<Button variant="outline" size="default" type="button" className="inset-ring-foreground">
{target}
</Button>
<Stack
gap="4"
align="stretch"
className={cn(
"w-full max-w-sm",
"rounded bg-card inset-ring inset-ring-border",
"p-4",
"shadow-md"
)}
role="group"
aria-label={title}
data-slot="tour-callout"
>
<Text size="xs" className="text-muted-foreground">
{position}
</Text>
<Text size="base" weight="semibold">
{title}
</Text>
<Text size="sm" className="text-muted-foreground">
{text}
</Text>
<Group gap="2" justify="end">
<Button variant="ghost" size="sm" type="button">
{skip}
</Button>
<Button variant="default" size="sm" type="button">
{next}
</Button>
</Group>
</Stack>
</Block>
</SectionFrame>
);
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework vue --dir src --registry-url https://registry.buildy.tw/vue --strict-cdnnpx ui8kit add tour-callout<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!--
One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the
position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target),
tone, density.
-->
<script lang="ts">
export type TourCalloutProps = {
id: string;
title: string;
text: string;
target: string;
position: string;
skip: string;
next: string;
placement?: "below" | "above" | "end";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import Block from "../compose/Block.vue";
import Button from "../compose/Button.vue";
import Group from "../compose/Group.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import SectionFrame from "../components/section-frame.vue";
import { cn } from "../utils";
const {
id,
title,
text,
target,
position,
skip,
next,
placement = "below",
tone = "default",
density = "default",
landmarkLabel,
} = defineProps<TourCalloutProps>();
</script>
<template>
<SectionFrame :id="id" :title="title" :tone="tone" :density="density" :landmarkLabel="landmarkLabel">
<Block
tag="div"
:class="cn(
'flex gap-4',
(
(placement as string) === 'end' ? 'flex-col items-start md:flex-row md:items-center'
: (placement as string) === 'above' ? 'flex-col-reverse items-start'
: 'flex-col items-start'
)
)"
:data-placement="placement"
data-slot="tour"
>
<Button variant="outline" size="default" type="button" class="inset-ring-foreground">
{{ target }}
</Button>
<Stack
gap="4"
align="stretch"
:class="cn('w-full max-w-sm', 'rounded bg-card inset-ring inset-ring-border', 'p-4', 'shadow-md')"
role="group"
:aria-label="title"
data-slot="tour-callout"
>
<Text size="xs" class="text-muted-foreground">
{{ position }}
</Text>
<Text size="base" weight="semibold">
{{ title }}
</Text>
<Text size="sm" class="text-muted-foreground">
{{ text }}
</Text>
<Group gap="2" justify="end">
<Button variant="ghost" size="sm" type="button">
{{ skip }}
</Button>
<Button variant="default" size="sm" type="button">
{{ next }}
</Button>
</Group>
</Stack>
</Block>
</SectionFrame>
</template>
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework solid --dir src --registry-url https://registry.buildy.tw/solid --strict-cdnnpx ui8kit add tour-callout// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/**
* One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the
* position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target),
* tone, density.
*/
import { type JSX } from "solid-js";
import { Block, Button, Group, Stack, Text } from "../compose";
import { SectionFrame } from "../components/section-frame";
import { cn } from "../utils";
export type TourCalloutProps = {
id: string;
title: string;
text: string;
target: string;
position: string;
skip: string;
next: string;
placement?: "below" | "above" | "end";
tone?: "default" | "muted";
density?: "default" | "compact";
landmarkLabel?: string;
};
export function TourCallout({
id,
title,
text,
target,
position,
skip,
next,
placement = "below",
tone = "default",
density = "default",
landmarkLabel,
}: TourCalloutProps) {
return (
<SectionFrame id={id} title={title} tone={tone} density={density} landmarkLabel={landmarkLabel}>
<Block
tag="div"
class={cn(
"flex gap-4",
(
(placement as string) === "end" ? "flex-col items-start md:flex-row md:items-center"
: (placement as string) === "above" ? "flex-col-reverse items-start"
: "flex-col items-start"
)
)}
data-placement={placement}
data-slot="tour"
>
<Button variant="outline" size="default" type="button" class="inset-ring-foreground">
{target}
</Button>
<Stack
gap="4"
align="stretch"
class={cn("w-full max-w-sm", "rounded bg-card inset-ring inset-ring-border", "p-4", "shadow-md")}
role="group"
aria-label={title}
data-slot="tour-callout"
>
<Text size="xs" class="text-muted-foreground">
{position}
</Text>
<Text size="base" weight="semibold">
{title}
</Text>
<Text size="sm" class="text-muted-foreground">
{text}
</Text>
<Group gap="2" justify="end">
<Button variant="ghost" size="sm" type="button">
{skip}
</Button>
<Button variant="default" size="sm" type="button">
{next}
</Button>
</Group>
</Stack>
</Block>
</SectionFrame>
);
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework templ --dir src --registry-url https://registry.buildy.tw/templ --strict-cdnnpx ui8kit add tour-callout// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
// Source: packages/compose-gen/specs/organisms/tour-callout.json
package blocks
import (
"github.com/ui8kit/codegen/generated/templ/ui/box"
"github.com/ui8kit/codegen/generated/templ/ui/button"
"github.com/ui8kit/codegen/generated/templ/compose"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// TourCalloutProps are the props of TourCallout; the values are the JSON shapes of the TypeScript props.
type TourCalloutProps struct {
Id any `json:"id"`
Title any `json:"title"`
Text any `json:"text"`
Target any `json:"target"`
Position any `json:"position"`
Skip any `json:"skip"`
Next any `json:"next"`
Placement any `json:"placement"`
Tone any `json:"tone"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target), tone, density.
templ TourCallout(p TourCalloutProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vText := p.Text }}
{{ vTarget := p.Target }}
{{ vPosition := p.Position }}
{{ vSkip := p.Skip }}
{{ vNext := p.Next }}
{{ vPlacement := uiutils.Def(p.Placement, "below") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel}) {
@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "div", Class: uiutils.S(uiutils.Cnv("flex gap-4", uiutils.Cond(uiutils.T(uiutils.Eq(vPlacement, "end")), "flex-col items-start md:flex-row md:items-center", uiutils.Cond(uiutils.T(uiutils.Eq(vPlacement, "above")), "flex-col-reverse items-start", "flex-col items-start")))), Attrs: uiutils.Attrs("data-placement", vPlacement, "data-slot", "tour")}}) {
@compose.Button(compose.ButtonProps{Variant: "outline", Size: "default", ButtonProps: button.ButtonProps{Type: "button", Class: "inset-ring-foreground"}}) {
{ uiutils.Text(vTarget) }
}
@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("w-full max-w-sm", "rounded bg-card inset-ring inset-ring-border", "p-4", "shadow-md")), Attrs: uiutils.Attrs("role", "group", "aria-label", vTitle, "data-slot", "tour-callout")}}) {
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(vPosition) }
}
@compose.Text(compose.TextProps{Size: "base", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(vTitle) }
}
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(vText) }
}
@compose.Group(compose.GroupProps{Gap: "2", Justify: "end", BoxProps: box.BoxProps{}}) {
@compose.Button(compose.ButtonProps{Variant: "ghost", Size: "sm", ButtonProps: button.ButtonProps{Type: "button"}}) {
{ uiutils.Text(vSkip) }
}
@compose.Button(compose.ButtonProps{Variant: "default", Size: "sm", ButtonProps: button.ButtonProps{Type: "button"}}) {
{ uiutils.Text(vNext) }
}
}
}
}
}
}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework twig --dir src --registry-url https://registry.buildy.tw/twig --strict-cdnnpx ui8kit add tour-callout{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/tour-callout.json
One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target), tone, density.
Props (p): id, title, text, target, position, skip, next, placement, tone, density, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_text = (p.text ?? null) -%}
{%- set v_target = (p.target ?? null) -%}
{%- set v_position = (p.position ?? null) -%}
{%- set v_skip = (p.skip ?? null) -%}
{%- set v_next = (p.next ?? null) -%}
{%- set v_placement = (p.placement ?? 'below') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_10 -%}
{%- set c_9 -%}
{%- set c_1 -%}
{{ og_text(v_target) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'default', 'type': 'button', 'class': 'inset-ring-foreground', 'children': c_1}, with_context = false) }}
{%- set c_8 -%}
{%- set c_2 -%}
{{ og_text(v_position) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_2}, with_context = false) }}
{%- set c_3 -%}
{{ og_text(v_title) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'base', 'weight': 'semibold', 'children': c_3}, with_context = false) }}
{%- set c_4 -%}
{{ og_text(v_text) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_4}, with_context = false) }}
{%- set c_7 -%}
{%- set c_5 -%}
{{ og_text(v_skip) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'ghost', 'size': 'sm', 'type': 'button', 'children': c_5}, with_context = false) }}
{%- set c_6 -%}
{{ og_text(v_next) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'sm', 'type': 'button', 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '2', 'justify': 'end', 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': og_s(og_cnv(['w-full max-w-sm', 'rounded bg-card inset-ring inset-ring-border', 'p-4', 'shadow-md'])), 'attrs': og_attrs(['role', 'group', 'aria-label', v_title, 'data-slot', 'tour-callout']), 'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'div', 'class': og_s(og_cnv(['flex gap-4', (og_t(og_eq(v_placement, 'end')) ? 'flex-col items-start md:flex-row md:items-center' : (og_t(og_eq(v_placement, 'above')) ? 'flex-col-reverse items-start' : 'flex-col items-start'))])), 'attrs': og_attrs(['data-placement', v_placement, 'data-slot', 'tour']), 'children': c_9}, with_context = false) }}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_10)}, with_context = false) }}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework latte --dir src --registry-url https://registry.buildy.tw/latte --strict-cdnnpx ui8kit add tour-callout{* Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/tour-callout.json
One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target), tone, density.
Props (p): id, title, text, target, position, skip, next, placement, tone, density, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_text = ($p['text'] ?? null)}
{var $v_target = ($p['target'] ?? null)}
{var $v_position = ($p['position'] ?? null)}
{var $v_skip = ($p['skip'] ?? null)}
{var $v_next = ($p['next'] ?? null)}
{var $v_placement = ($p['placement'] ?? 'below')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_10}
{capture $c_9}
{capture $c_1}
{=og_text($v_target)}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'default', 'type' => 'button', 'class' => 'inset-ring-foreground', 'children' => (string) $c_1])|noescape}
{capture $c_8}
{capture $c_2}
{=og_text($v_position)}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_2])|noescape}
{capture $c_3}
{=og_text($v_title)}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'base', 'weight' => 'semibold', 'children' => (string) $c_3])|noescape}
{capture $c_4}
{=og_text($v_text)}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_4])|noescape}
{capture $c_7}
{capture $c_5}
{=og_text($v_skip)}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'ghost', 'size' => 'sm', 'type' => 'button', 'children' => (string) $c_5])|noescape}
{capture $c_6}
{=og_text($v_next)}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'default', 'size' => 'sm', 'type' => 'button', 'children' => (string) $c_6])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '2', 'justify' => 'end', 'children' => (string) $c_7])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => og_s(og_cnv(['w-full max-w-sm', 'rounded bg-card inset-ring inset-ring-border', 'p-4', 'shadow-md'])), 'attrs' => og_attrs(['role', 'group', 'aria-label', $v_title, 'data-slot', 'tour-callout']), 'children' => (string) $c_8])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'div', 'class' => og_s(og_cnv(['flex gap-4', (og_t(og_eq($v_placement, 'end')) ? 'flex-col items-start md:flex-row md:items-center' : (og_t(og_eq($v_placement, 'above')) ? 'flex-col-reverse items-start' : 'flex-col items-start'))])), 'attrs' => og_attrs(['data-placement', $v_placement, 'data-slot', 'tour']), 'children' => (string) $c_9])|noescape}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'tone' => $v_tone, 'density' => $v_density, 'landmarkLabel' => $v_landmarkLabel], 'children' => og_markup($c_10)])|noescape}
Point the CLI at this runtime once, then add the item:
npx ui8kit init --yes --framework jinja2 --dir src --registry-url https://registry.buildy.tw/jinja2 --strict-cdnnpx ui8kit add tour-callout{#- Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
Source: packages/compose-gen/specs/organisms/tour-callout.json
One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target), tone, density.
Props (p): id, title, text, target, position, skip, next, placement, tone, density, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_text = og_def(p['text'], none) -%}
{%- set v_target = og_def(p['target'], none) -%}
{%- set v_position = og_def(p['position'], none) -%}
{%- set v_skip = og_def(p['skip'], none) -%}
{%- set v_next = og_def(p['next'], none) -%}
{%- set v_placement = og_def(p['placement'], 'below') -%}
{%- set v_tone = og_def(p['tone'], 'default') -%}
{%- set v_density = og_def(p['density'], 'default') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_10 -%}
{%- set c_9 -%}
{%- set c_1 -%}
{{ og_text(v_target) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Type': 'button', 'Class': 'inset-ring-foreground'}, 'children': c_1}) }}
{%- set c_8 -%}
{%- set c_2 -%}
{{ og_text(v_position) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}
{%- set c_3 -%}
{{ og_text(v_title) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'base', 'Weight': 'semibold'}, 'children': c_3}) }}
{%- set c_4 -%}
{{ og_text(v_text) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_4}) }}
{%- set c_7 -%}
{%- set c_5 -%}
{{ og_text(v_skip) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'ghost', 'Size': 'sm', 'Type': 'button'}, 'children': c_5}) }}
{%- set c_6 -%}
{{ og_text(v_next) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'sm', 'Type': 'button'}, 'children': c_6}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Justify': 'end'}, 'children': c_7}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': og_s(og_cnv(['w-full max-w-sm', 'rounded bg-card inset-ring inset-ring-border', 'p-4', 'shadow-md'])), 'Attrs': og_attrs(['role', 'group', 'aria-label', v_title, 'data-slot', 'tour-callout'])}, 'children': c_8}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'div', 'Class': og_s(og_cnv(['flex gap-4', ('flex-col items-start md:flex-row md:items-center' if og_t(og_eq(v_placement, 'end')) else ('flex-col-reverse items-start' if og_t(og_eq(v_placement, 'above')) else 'flex-col items-start'))])), 'Attrs': og_attrs(['data-placement', v_placement, 'data-slot', 'tour'])}, 'children': c_9}) }}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel}, 'children': og_markup(c_10)}) }}
Props
Names and types come from the xgen specs of the source. Standard HTML attributes (id, role, tabIndex, aria-*) pass through to the root element; the class prop is className in React.
One stop of a product tour: the element being explained and a callout beside it with a title, a sentence, the position in the tour and the buttons. Axes: placement (below, above, end: the callout sits beside the target), tone, density.
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | |
| title (required) | string | - | |
| text (required) | string | - | |
| target (required) | string | - | the name of the explained element, drawn as a button |
| position (required) | string | - | e.g. `Step 2 of 4` |
| skip (required) | string | - | |
| next (required) | string | - | |
| placement | "below" | "above" | "end" | "below" | |
| tone | "default" | "muted" | "default" | |
| density | "default" | "compact" | "default" | |
| landmarkLabel | string | - | accessible name of the landmark of this component when the page shows it more than once (a variant); replaces the heading name of the root landmark, follows the name of a nested one |