Skip to content
ui8kit

component / components

Media Steps

Media Steps component

Install

npx ui8kit add media-steps

Pulls in: compose, group, inline, kit-box, kit-text, lucide-icon, media-list, stack, text, utils

Preview

The process

01

Pick a plan

Start free and upgrade when the team grows.

02

Connect your data

Point the site at your collections and content.

03

Choose the blocks

Compose pages from ready blocks and variants.

04

Publish

Ship to every runtime with one command.

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-cdn
npx ui8kit add media-steps
components/media-steps.svelte
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!-- The steps of MediaList as numbered rows: the number, a glyph, the title and the text. -->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { MediaExtras, MediaListLabels } from "../blocks/media-list.types";

  export type MediaStepsProps = {
    extras: MediaExtras;
    labels: MediaListLabels;
  };
</script>

<script lang="ts">
  import Group from "../compose/Group.svelte";
  import Inline from "../compose/Inline.svelte";
  import LucideIcon from "../icons/LucideIcon.svelte";
  import Stack from "../compose/Stack.svelte";
  import Text from "../compose/Text.svelte";
  import { tpl } from "../utils";

  let { extras, labels }: MediaStepsProps = $props();
</script>

<Stack gap="4" align="stretch" data-slot="media-steps">
  <Text size="sm" weight="semibold">
    {labels.list}
  </Text>
  {#each extras.steps as s, i (s.id)}
    <Group gap="4" align="start" data-slot="media-step">
      <Text size="sm" weight="semibold" class="w-6 shrink-0 text-primary">
        {tpl("0{0}", ((i + 1) == null ? undefined : String((i + 1))))}
      </Text>
      <Inline class="flex size-6 shrink-0 items-center justify-center text-primary">
        <LucideIcon name={s.icon} size={16} />
      </Inline>
      <Stack gap="0">
        <Text size="sm" weight="semibold">
          {s.title}
        </Text>
        <Text size="sm" class="text-muted-foreground">
          {s.text}
        </Text>
      </Stack>
    </Group>
  {/each}
</Stack>

Svelte registry item (JSON)

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-cdn
npx ui8kit add media-steps
components/media-steps.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/** The steps of MediaList as numbered rows: the number, a glyph, the title and the text. */
import { type ReactNode } from "react";
import { Group, Inline, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { tpl } from "../utils";
import type { MediaExtras, MediaListLabels } from "../blocks/media-list.types";

export type MediaStepsProps = {
  extras: MediaExtras;
  labels: MediaListLabels;
};

export function MediaSteps({ extras, labels }: MediaStepsProps) {
  return (
    <Stack gap="4" align="stretch" data-slot="media-steps">
      <Text size="sm" weight="semibold">
        {labels.list}
      </Text>
      {(extras.steps ?? []).map((s, i) => (
        <Group key={s.id} gap="4" align="start" data-slot="media-step">
          <Text size="sm" weight="semibold" className="w-6 shrink-0 text-primary">
            {tpl("0{0}", ((i + 1) == null ? undefined : String((i + 1))))}
          </Text>
          <Inline className="flex size-6 shrink-0 items-center justify-center text-primary">
            <LucideIcon name={s.icon} size={16} />
          </Inline>
          <Stack gap="0">
            <Text size="sm" weight="semibold">
              {s.title}
            </Text>
            <Text size="sm" className="text-muted-foreground">
              {s.text}
            </Text>
          </Stack>
        </Group>
      ))}
    </Stack>
  );
}

React registry item (JSON)

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-cdn
npx ui8kit add media-steps
components/media-steps.vue
<!-- Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT. -->
<!-- The steps of MediaList as numbered rows: the number, a glyph, the title and the text. -->
<script lang="ts">
import type { MediaExtras, MediaListLabels } from "../blocks/media-list.types";

export type MediaStepsProps = {
  extras: MediaExtras;
  labels: MediaListLabels;
};
</script>

<script setup lang="ts">
import Group from "../compose/Group.vue";
import Inline from "../compose/Inline.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import { tpl } from "../utils";

const { extras, labels } = defineProps<MediaStepsProps>();
</script>

<template>
  <Stack gap="4" align="stretch" data-slot="media-steps">
    <Text size="sm" weight="semibold">
      {{ labels.list }}
    </Text>
    <Group v-for="(s, i) in extras.steps" :key="s.id" gap="4" align="start" data-slot="media-step">
      <Text size="sm" weight="semibold" class="w-6 shrink-0 text-primary">
        {{ tpl("0{0}", ((i + 1) == null ? undefined : String((i + 1)))) }}
      </Text>
      <Inline class="flex size-6 shrink-0 items-center justify-center text-primary">
        <LucideIcon :name="s.icon" :size="16" />
      </Inline>
      <Stack gap="0">
        <Text size="sm" weight="semibold">
          {{ s.title }}
        </Text>
        <Text size="sm" class="text-muted-foreground">
          {{ s.text }}
        </Text>
      </Stack>
    </Group>
  </Stack>
</template>

Vue registry item (JSON)

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-cdn
npx ui8kit add media-steps
components/media-steps.tsx
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
/** The steps of MediaList as numbered rows: the number, a glyph, the title and the text. */
import { For, type JSX } from "solid-js";
import { Group, Inline, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { tpl } from "../utils";
import type { MediaExtras, MediaListLabels } from "../blocks/media-list.types";

export type MediaStepsProps = {
  extras: MediaExtras;
  labels: MediaListLabels;
};

export function MediaSteps({ extras, labels }: MediaStepsProps) {
  return (
    <Stack gap="4" align="stretch" data-slot="media-steps">
      <Text size="sm" weight="semibold">
        {labels.list}
      </Text>
      <For each={extras.steps ?? []}>{(s, iOf) => { const i = iOf(); return (
        <Group gap="4" align="start" data-slot="media-step">
          <Text size="sm" weight="semibold" class="w-6 shrink-0 text-primary">
            {tpl("0{0}", ((i + 1) == null ? undefined : String((i + 1))))}
          </Text>
          <Inline class="flex size-6 shrink-0 items-center justify-center text-primary">
            <LucideIcon name={s.icon} size={16} />
          </Inline>
          <Stack gap="0">
            <Text size="sm" weight="semibold">
              {s.title}
            </Text>
            <Text size="sm" class="text-muted-foreground">
              {s.text}
            </Text>
          </Stack>
        </Group>
      ); }}</For>
    </Stack>
  );
}

Solid registry item (JSON)

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-cdn
npx ui8kit add media-steps
blocks/media-steps.templ
// 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/media-steps.json

package blocks

import (
	"github.com/ui8kit/codegen/generated/templ/ui/box"
	"github.com/ui8kit/codegen/generated/templ/compose"
	"github.com/ui8kit/codegen/generated/templ/icons"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// MediaStepsProps are the props of MediaSteps; the values are the JSON shapes of the TypeScript props.
type MediaStepsProps struct {
	Extras any `json:"extras"`
	Labels any `json:"labels"`
}

// The steps of MediaList as numbered rows: the number, a glyph, the title and the text.
templ MediaSteps(p MediaStepsProps) {
	{{ vExtras := p.Extras }}
	{{ vLabels := p.Labels }}
	@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "media-steps")}}) {
		@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
			{ uiutils.Text(uiutils.Get(vLabels, "list")) }
		}
		for vI, vS := range uiutils.L(uiutils.Get(vExtras, "steps")) {
			@compose.Group(compose.GroupProps{Gap: "4", Align: "start", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "media-step")}}) {
				@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{Class: "w-6 shrink-0 text-primary"}}) {
					{ uiutils.Text(uiutils.Tpl("0{0}", uiutils.Str(uiutils.Add(float64(vI), float64(1))))) }
				}
				@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: "flex size-6 shrink-0 items-center justify-center text-primary"}}) {
					@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Get(vS, "icon")), Size: 16})
				}
				@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{}}) {
					@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
						{ uiutils.Text(uiutils.Get(vS, "title")) }
					}
					@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
						{ uiutils.Text(uiutils.Get(vS, "text")) }
					}
				}
			}
		}
	}
}

templ registry item (JSON)

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-cdn
npx ui8kit add media-steps
blocks/media-steps.html.twig
{#- 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/media-steps.json
    The steps of MediaList as numbered rows: the number, a glyph, the title and the text.
    Props (p): extras, labels. -#}
{%- set v_extras = (p.extras ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set c_8 -%}
  {%- set c_1 -%}
    {{ og_text(og_get(v_labels, ['list'])) }}
  {%- endset -%}
  {{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_1}, with_context = false) }}
  {%- for v_s in og_l(og_get(v_extras, ['steps'])) %}
    {%- set v_i = loop.index0 -%}
    {%- set c_7 -%}
      {%- set c_2 -%}
        {{ og_text(og_tpl('0{0}', [og_str(og_add(v_i, 1))])) }}
      {%- endset -%}
      {{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'class': 'w-6 shrink-0 text-primary', 'children': c_2}, with_context = false) }}
      {%- set c_3 -%}
        {{ include('icons/LucideIcon.html.twig', {'name': og_s(og_get(v_s, ['icon'])), 'size': 16}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Inline.html.twig', {'class': 'flex size-6 shrink-0 items-center justify-center text-primary', 'children': c_3}, with_context = false) }}
      {%- set c_6 -%}
        {%- set c_4 -%}
          {{ og_text(og_get(v_s, ['title'])) }}
        {%- endset -%}
        {{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_4}, with_context = false) }}
        {%- set c_5 -%}
          {{ og_text(og_get(v_s, ['text'])) }}
        {%- endset -%}
        {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_5}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Stack.html.twig', {'gap': '0', 'children': c_6}, with_context = false) }}
    {%- endset -%}
    {{ include('compose/Group.html.twig', {'gap': '4', 'align': 'start', 'attrs': og_attrs(['data-slot', 'media-step']), 'children': c_7}, with_context = false) }}
  {%- endfor %}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'attrs': og_attrs(['data-slot', 'media-steps']), 'children': c_8}, with_context = false) }}

Twig registry item (JSON)

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-cdn
npx ui8kit add media-steps
blocks/media-steps.latte
{* 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/media-steps.json
    The steps of MediaList as numbered rows: the number, a glyph, the title and the text.
    Props (p): extras, labels. *}
{var $v_extras = ($p['extras'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{capture $c_8}
  {capture $c_1}
    {=og_text(og_get($v_labels, ['list']))}
  {/capture}
  {=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_1])|noescape}
  {foreach og_l(og_get($v_extras, ['steps'])) as $v_s}
    {var $v_i = $iterator->counter0}
    {capture $c_7}
      {capture $c_2}
        {=og_text(og_tpl('0{0}', [og_str(og_add($v_i, 1))]))}
      {/capture}
      {=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'class' => 'w-6 shrink-0 text-primary', 'children' => (string) $c_2])|noescape}
      {capture $c_3}
        {=og_include('icons/LucideIcon.latte', ['name' => og_s(og_get($v_s, ['icon'])), 'size' => 16])|noescape}
      {/capture}
      {=og_include('compose/Inline.latte', ['class' => 'flex size-6 shrink-0 items-center justify-center text-primary', 'children' => (string) $c_3])|noescape}
      {capture $c_6}
        {capture $c_4}
          {=og_text(og_get($v_s, ['title']))}
        {/capture}
        {=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_4])|noescape}
        {capture $c_5}
          {=og_text(og_get($v_s, ['text']))}
        {/capture}
        {=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_5])|noescape}
      {/capture}
      {=og_include('compose/Stack.latte', ['gap' => '0', 'children' => (string) $c_6])|noescape}
    {/capture}
    {=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'start', 'attrs' => og_attrs(['data-slot', 'media-step']), 'children' => (string) $c_7])|noescape}
  {/foreach}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'attrs' => og_attrs(['data-slot', 'media-steps']), 'children' => (string) $c_8])|noescape}

Latte registry item (JSON)

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-cdn
npx ui8kit add media-steps
blocks/media-steps.html.j2
{#- 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/media-steps.json
    The steps of MediaList as numbered rows: the number, a glyph, the title and the text.
    Props (p): extras, labels. -#}
{%- set v_extras = og_def(p['extras'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set c_8 -%}
  {%- set c_1 -%}
    {{ og_text(og_get(v_labels, ['list'])) }}
  {%- endset -%}
  {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_1}) }}
  {%- for v_s in og_l(og_get(v_extras, ['steps'])) %}
    {%- set v_i = loop.index0 -%}
    {%- set c_7 -%}
      {%- set c_2 -%}
        {{ og_text(og_tpl('0{0}', [og_str(og_add(v_i, 1))])) }}
      {%- endset -%}
      {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold', 'Class': 'w-6 shrink-0 text-primary'}, 'children': c_2}) }}
      {%- set c_3 -%}
        {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(og_get(v_s, ['icon'])), 'Size': 16}}) }}
      {%- endset -%}
      {{ og_include('compose/inline.html.j2', {'p': {'Class': 'flex size-6 shrink-0 items-center justify-center text-primary'}, 'children': c_3}) }}
      {%- set c_6 -%}
        {%- set c_4 -%}
          {{ og_text(og_get(v_s, ['title'])) }}
        {%- endset -%}
        {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_4}) }}
        {%- set c_5 -%}
          {{ og_text(og_get(v_s, ['text'])) }}
        {%- endset -%}
        {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_5}) }}
      {%- endset -%}
      {{ og_include('compose/stack.html.j2', {'p': {'Gap': '0'}, 'children': c_6}) }}
    {%- endset -%}
    {{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'start', 'Attrs': og_attrs(['data-slot', 'media-step'])}, 'children': c_7}) }}
  {%- endfor %}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Attrs': og_attrs(['data-slot', 'media-steps'])}, 'children': c_8}) }}

Jinja2 registry item (JSON)

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.

The steps of MediaList as numbered rows: the number, a glyph, the title and the text.

Props of MediaSteps
PropTypeDefault Description
extras (required)MediaExtras-
labels (required)MediaListLabels-

Used in