Skip to content
ui8kit

component / components

Lightbox Stage

Lightbox Stage component

Install

npx ui8kit add lightbox-stage

Pulls in: button, compose, dialog, group, kit-box, kit-button, kit-dialog, kit-text, lightbox-gallery, lucide-icon, media-frame, photo-gallery, text, utils

Preview

Harbor at dawn

Travel

1 of 9

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 lightbox-stage
components/lightbox-stage.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 selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state.
  Used by LightboxGallery.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { LightboxLabels } from "../blocks/lightbox-gallery.types";
  import type { Photo } from "../blocks/photo-gallery.types";

  export type LightboxStageProps = {
    photos: Photo[];
    labels: LightboxLabels;
    captions?: "show" | "hide";
    lightbox?: "open" | "closed";
  };
</script>

<script lang="ts">
  import Button from "../compose/Button.svelte";
  import Dialog from "../compose/Dialog.svelte";
  import Group from "../compose/Group.svelte";
  import LucideIcon from "../icons/LucideIcon.svelte";
  import Text from "../compose/Text.svelte";
  import MediaFrame from "../components/media-frame.svelte";
  import { tpl } from "../utils";

  let { photos, labels, captions = "show", lightbox = "closed" }: LightboxStageProps = $props();
</script>

<Dialog
  open={((lightbox as string) === "open")}
  size="xl"
  aria-label={photos[0]?.title ?? ""}
  class="gap-4 p-4"
  data-slot="lightbox"
>
  <Group gap="2" align="center" justify="between">
    <Text size="sm" weight="semibold">
      {photos[0]?.title ?? ""}
    </Text>
    <Button variant="ghost" size="sm" layout="icon" type="button" aria-label={labels.close}>
      <LucideIcon name="x" size={16} />
    </Button>
  </Group>
  <MediaFrame alt={photos[0]?.title ?? ""} src={photos[0]?.image ?? ""} ratio="4/3" />
  {#if ((captions as string) === "show")}
    <Text size="sm" class="text-muted-foreground">
      {photos[0]?.tag ?? ""}
    </Text>
  {/if}
  <Group gap="2" align="center" justify="between">
    <Text size="xs" class="text-muted-foreground">
      {tpl(labels.counter, 1, (photos?.length ?? 0))}
    </Text>
    <Group gap="2">
      <Button variant="outline" size="sm" layout="icon" type="button" aria-label={labels.previous}>
        <LucideIcon name="chevron-left" size={16} />
      </Button>
      <Button variant="outline" size="sm" layout="icon" type="button" aria-label={labels.next}>
        <LucideIcon name="chevron-right" size={16} />
      </Button>
    </Group>
  </Group>
</Dialog>

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 lightbox-stage
components/lightbox-stage.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 selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state.
 * Used by LightboxGallery.
 */
import { type ReactNode } from "react";
import { Button, Dialog, Group, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { tpl } from "../utils";
import type { LightboxLabels } from "../blocks/lightbox-gallery.types";
import type { Photo } from "../blocks/photo-gallery.types";

export type LightboxStageProps = {
  photos: Photo[];
  labels: LightboxLabels;
  captions?: "show" | "hide";
  lightbox?: "open" | "closed";
};

export function LightboxStage({
  photos,
  labels,
  captions = "show",
  lightbox = "closed",
}: LightboxStageProps) {
  return (
    <Dialog
      open={((lightbox as string) === "open")}
      size="xl"
      aria-label={photos[0]?.title ?? ""}
      className="gap-4 p-4"
      data-slot="lightbox"
    >
      <Group gap="2" align="center" justify="between">
        <Text size="sm" weight="semibold">
          {photos[0]?.title ?? ""}
        </Text>
        <Button variant="ghost" size="sm" layout="icon" type="button" aria-label={labels.close}>
          <LucideIcon name="x" size={16} />
        </Button>
      </Group>
      <MediaFrame alt={photos[0]?.title ?? ""} src={photos[0]?.image ?? ""} ratio="4/3" />
      {((captions as string) === "show") ? (
        <Text size="sm" className="text-muted-foreground">
          {photos[0]?.tag ?? ""}
        </Text>
      ) : null}
      <Group gap="2" align="center" justify="between">
        <Text size="xs" className="text-muted-foreground">
          {tpl(labels.counter, 1, (photos?.length ?? 0))}
        </Text>
        <Group gap="2">
          <Button variant="outline" size="sm" layout="icon" type="button" aria-label={labels.previous}>
            <LucideIcon name="chevron-left" size={16} />
          </Button>
          <Button variant="outline" size="sm" layout="icon" type="button" aria-label={labels.next}>
            <LucideIcon name="chevron-right" size={16} />
          </Button>
        </Group>
      </Group>
    </Dialog>
  );
}

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 lightbox-stage
components/lightbox-stage.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 selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state.
  Used by LightboxGallery.
-->
<script lang="ts">
import type { LightboxLabels } from "../blocks/lightbox-gallery.types";
import type { Photo } from "../blocks/photo-gallery.types";

export type LightboxStageProps = {
  photos: Photo[];
  labels: LightboxLabels;
  captions?: "show" | "hide";
  lightbox?: "open" | "closed";
};
</script>

<script setup lang="ts">
import Button from "../compose/Button.vue";
import Dialog from "../compose/Dialog.vue";
import Group from "../compose/Group.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Text from "../compose/Text.vue";
import MediaFrame from "../components/media-frame.vue";
import { tpl } from "../utils";

const { photos, labels, captions = "show", lightbox = "closed" } = defineProps<LightboxStageProps>();
</script>

<template>
  <Dialog
    :open="((lightbox as string) === 'open')"
    size="xl"
    :aria-label="photos[0]?.title ?? ''"
    class="gap-4 p-4"
    data-slot="lightbox"
  >
    <Group gap="2" align="center" justify="between">
      <Text size="sm" weight="semibold">
        {{ photos[0]?.title ?? "" }}
      </Text>
      <Button variant="ghost" size="sm" layout="icon" type="button" :aria-label="labels.close">
        <LucideIcon name="x" :size="16" />
      </Button>
    </Group>
    <MediaFrame :alt="photos[0]?.title ?? ''" :src="photos[0]?.image ?? ''" ratio="4/3" />
    <Text v-if="((captions as string) === 'show')" size="sm" class="text-muted-foreground">
      {{ photos[0]?.tag ?? "" }}
    </Text>
    <Group gap="2" align="center" justify="between">
      <Text size="xs" class="text-muted-foreground">
        {{ tpl(labels.counter, 1, (photos?.length ?? 0)) }}
      </Text>
      <Group gap="2">
        <Button variant="outline" size="sm" layout="icon" type="button" :aria-label="labels.previous">
          <LucideIcon name="chevron-left" :size="16" />
        </Button>
        <Button variant="outline" size="sm" layout="icon" type="button" :aria-label="labels.next">
          <LucideIcon name="chevron-right" :size="16" />
        </Button>
      </Group>
    </Group>
  </Dialog>
</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 lightbox-stage
components/lightbox-stage.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 selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state.
 * Used by LightboxGallery.
 */
import { type JSX } from "solid-js";
import { Button, Dialog, Group, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { tpl } from "../utils";
import type { LightboxLabels } from "../blocks/lightbox-gallery.types";
import type { Photo } from "../blocks/photo-gallery.types";

export type LightboxStageProps = {
  photos: Photo[];
  labels: LightboxLabels;
  captions?: "show" | "hide";
  lightbox?: "open" | "closed";
};

export function LightboxStage({
  photos,
  labels,
  captions = "show",
  lightbox = "closed",
}: LightboxStageProps) {
  return (
    <Dialog
      open={((lightbox as string) === "open")}
      size="xl"
      aria-label={photos[0]?.title ?? ""}
      class="gap-4 p-4"
      data-slot="lightbox"
    >
      <Group gap="2" align="center" justify="between">
        <Text size="sm" weight="semibold">
          {photos[0]?.title ?? ""}
        </Text>
        <Button variant="ghost" size="sm" layout="icon" type="button" aria-label={labels.close}>
          <LucideIcon name="x" size={16} />
        </Button>
      </Group>
      <MediaFrame alt={photos[0]?.title ?? ""} src={photos[0]?.image ?? ""} ratio="4/3" />
      {((captions as string) === "show") ? (
        <Text size="sm" class="text-muted-foreground">
          {photos[0]?.tag ?? ""}
        </Text>
      ) : null}
      <Group gap="2" align="center" justify="between">
        <Text size="xs" class="text-muted-foreground">
          {tpl(labels.counter, 1, (photos?.length ?? 0))}
        </Text>
        <Group gap="2">
          <Button variant="outline" size="sm" layout="icon" type="button" aria-label={labels.previous}>
            <LucideIcon name="chevron-left" size={16} />
          </Button>
          <Button variant="outline" size="sm" layout="icon" type="button" aria-label={labels.next}>
            <LucideIcon name="chevron-right" size={16} />
          </Button>
        </Group>
      </Group>
    </Dialog>
  );
}

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 lightbox-stage
blocks/lightbox-stage.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/lightbox-stage.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/dialog"
	"github.com/ui8kit/codegen/generated/templ/icons"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// LightboxStageProps are the props of LightboxStage; the values are the JSON shapes of the TypeScript props.
type LightboxStageProps struct {
	Photos any `json:"photos"`
	Labels any `json:"labels"`
	Captions any `json:"captions"`
	Lightbox any `json:"lightbox"`
}

// The selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state. Used by LightboxGallery.
templ LightboxStage(p LightboxStageProps) {
	{{ vPhotos := p.Photos }}
	{{ vLabels := p.Labels }}
	{{ vCaptions := uiutils.Def(p.Captions, "show") }}
	{{ vLightbox := uiutils.Def(p.Lightbox, "closed") }}
	@compose.Dialog(compose.DialogProps{Size: "xl", DialogProps: dialog.DialogProps{Open: uiutils.T(uiutils.Eq(vLightbox, "open")), AriaLabel: uiutils.S(uiutils.FirstOf(vPhotos, "title")), Class: "gap-4 p-4", Attrs: uiutils.Attrs("data-slot", "lightbox")}}) {
		@compose.Group(compose.GroupProps{Gap: "2", Align: "center", Justify: "between", BoxProps: box.BoxProps{}}) {
			@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
				{ uiutils.Text(uiutils.FirstOf(vPhotos, "title")) }
			}
			@compose.Button(compose.ButtonProps{Variant: "ghost", Size: "sm", Layout: "icon", ButtonProps: button.ButtonProps{Type: "button", AriaLabel: uiutils.S(uiutils.Get(vLabels, "close"))}}) {
				@icons.LucideIcon(icons.LucideIconProps{Name: "x", Size: 16})
			}
		}
		@MediaFrame(MediaFrameProps{Alt: uiutils.FirstOf(vPhotos, "title"), Src: uiutils.FirstOf(vPhotos, "image"), Ratio: "4/3"})
		if uiutils.Eq(vCaptions, "show") {
			@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
				{ uiutils.Text(uiutils.FirstOf(vPhotos, "tag")) }
			}
		}
		@compose.Group(compose.GroupProps{Gap: "2", Align: "center", Justify: "between", BoxProps: box.BoxProps{}}) {
			@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
				{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, "counter"), float64(1), uiutils.Len(vPhotos))) }
			}
			@compose.Group(compose.GroupProps{Gap: "2", BoxProps: box.BoxProps{}}) {
				@compose.Button(compose.ButtonProps{Variant: "outline", Size: "sm", Layout: "icon", ButtonProps: button.ButtonProps{Type: "button", AriaLabel: uiutils.S(uiutils.Get(vLabels, "previous"))}}) {
					@icons.LucideIcon(icons.LucideIconProps{Name: "chevron-left", Size: 16})
				}
				@compose.Button(compose.ButtonProps{Variant: "outline", Size: "sm", Layout: "icon", ButtonProps: button.ButtonProps{Type: "button", AriaLabel: uiutils.S(uiutils.Get(vLabels, "next"))}}) {
					@icons.LucideIcon(icons.LucideIconProps{Name: "chevron-right", Size: 16})
				}
			}
		}
	}
}

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 lightbox-stage
blocks/lightbox-stage.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/lightbox-stage.json
    The selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state. Used by LightboxGallery.
    Props (p): photos, labels, captions, lightbox. -#}
{%- set v_photos = (p.photos ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_captions = (p.captions ?? 'show') -%}
{%- set v_lightbox = (p.lightbox ?? 'closed') -%}
{%- set c_10 -%}
  {%- set c_3 -%}
    {%- set c_1 -%}
      {{ og_text(og_first_of(v_photos, 'title')) }}
    {%- endset -%}
    {{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_1}, with_context = false) }}
    {%- set c_2 -%}
      {{ include('icons/LucideIcon.html.twig', {'name': 'x', 'size': 16}, with_context = false) }}
    {%- endset -%}
    {{ include('compose/Button.html.twig', {'variant': 'ghost', 'size': 'sm', 'layout': 'icon', 'type': 'button', 'ariaLabel': og_s(og_get(v_labels, ['close'])), 'children': c_2}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'justify': 'between', 'children': c_3}, with_context = false) }}
  {{ include('blocks/media-frame.html.twig', {'p': {'alt': og_first_of(v_photos, 'title'), 'src': og_first_of(v_photos, 'image'), 'ratio': '4/3'}}, with_context = false) }}
  {%- if og_t(og_eq(v_captions, 'show')) %}
    {%- set c_4 -%}
      {{ og_text(og_first_of(v_photos, 'tag')) }}
    {%- endset -%}
    {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_4}, with_context = false) }}
  {%- endif %}
  {%- set c_9 -%}
    {%- set c_5 -%}
      {{ og_text(og_tpl(og_get(v_labels, ['counter']), [1, og_len(v_photos)])) }}
    {%- endset -%}
    {{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_5}, with_context = false) }}
    {%- set c_8 -%}
      {%- set c_6 -%}
        {{ include('icons/LucideIcon.html.twig', {'name': 'chevron-left', 'size': 16}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'sm', 'layout': 'icon', 'type': 'button', 'ariaLabel': og_s(og_get(v_labels, ['previous'])), 'children': c_6}, with_context = false) }}
      {%- set c_7 -%}
        {{ include('icons/LucideIcon.html.twig', {'name': 'chevron-right', 'size': 16}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'sm', 'layout': 'icon', 'type': 'button', 'ariaLabel': og_s(og_get(v_labels, ['next'])), 'children': c_7}, with_context = false) }}
    {%- endset -%}
    {{ include('compose/Group.html.twig', {'gap': '2', 'children': c_8}, with_context = false) }}
  {%- endset -%}
  {{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'justify': 'between', 'children': c_9}, with_context = false) }}
{%- endset -%}
{{ include('compose/Dialog.html.twig', {'open': og_t(og_eq(v_lightbox, 'open')), 'size': 'xl', 'ariaLabel': og_s(og_first_of(v_photos, 'title')), 'class': 'gap-4 p-4', 'attrs': og_attrs(['data-slot', 'lightbox']), 'children': c_10}, 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 lightbox-stage
blocks/lightbox-stage.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/lightbox-stage.json
    The selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state. Used by LightboxGallery.
    Props (p): photos, labels, captions, lightbox. *}
{var $v_photos = ($p['photos'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_captions = ($p['captions'] ?? 'show')}
{var $v_lightbox = ($p['lightbox'] ?? 'closed')}
{capture $c_10}
  {capture $c_3}
    {capture $c_1}
      {=og_text(og_first_of($v_photos, 'title'))}
    {/capture}
    {=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_1])|noescape}
    {capture $c_2}
      {=og_include('icons/LucideIcon.latte', ['name' => 'x', 'size' => 16])|noescape}
    {/capture}
    {=og_include('compose/Button.latte', ['variant' => 'ghost', 'size' => 'sm', 'layout' => 'icon', 'type' => 'button', 'ariaLabel' => og_s(og_get($v_labels, ['close'])), 'children' => (string) $c_2])|noescape}
  {/capture}
  {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'justify' => 'between', 'children' => (string) $c_3])|noescape}
  {=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_first_of($v_photos, 'title'), 'src' => og_first_of($v_photos, 'image'), 'ratio' => '4/3']])|noescape}
  {if og_t(og_eq($v_captions, 'show'))}
    {capture $c_4}
      {=og_text(og_first_of($v_photos, 'tag'))}
    {/capture}
    {=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_4])|noescape}
  {/if}
  {capture $c_9}
    {capture $c_5}
      {=og_text(og_tpl(og_get($v_labels, ['counter']), [1, og_len($v_photos)]))}
    {/capture}
    {=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_5])|noescape}
    {capture $c_8}
      {capture $c_6}
        {=og_include('icons/LucideIcon.latte', ['name' => 'chevron-left', 'size' => 16])|noescape}
      {/capture}
      {=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'sm', 'layout' => 'icon', 'type' => 'button', 'ariaLabel' => og_s(og_get($v_labels, ['previous'])), 'children' => (string) $c_6])|noescape}
      {capture $c_7}
        {=og_include('icons/LucideIcon.latte', ['name' => 'chevron-right', 'size' => 16])|noescape}
      {/capture}
      {=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'sm', 'layout' => 'icon', 'type' => 'button', 'ariaLabel' => og_s(og_get($v_labels, ['next'])), 'children' => (string) $c_7])|noescape}
    {/capture}
    {=og_include('compose/Group.latte', ['gap' => '2', 'children' => (string) $c_8])|noescape}
  {/capture}
  {=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'justify' => 'between', 'children' => (string) $c_9])|noescape}
{/capture}
{=og_include('compose/Dialog.latte', ['open' => og_t(og_eq($v_lightbox, 'open')), 'size' => 'xl', 'ariaLabel' => og_s(og_first_of($v_photos, 'title')), 'class' => 'gap-4 p-4', 'attrs' => og_attrs(['data-slot', 'lightbox']), 'children' => (string) $c_10])|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 lightbox-stage
blocks/lightbox-stage.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/lightbox-stage.json
    The selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state. Used by LightboxGallery.
    Props (p): photos, labels, captions, lightbox. -#}
{%- set v_photos = og_def(p['photos'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_captions = og_def(p['captions'], 'show') -%}
{%- set v_lightbox = og_def(p['lightbox'], 'closed') -%}
{%- set c_10 -%}
  {%- set c_3 -%}
    {%- set c_1 -%}
      {{ og_text(og_first_of(v_photos, 'title')) }}
    {%- endset -%}
    {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_1}) }}
    {%- set c_2 -%}
      {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'x', 'Size': 16}}) }}
    {%- endset -%}
    {{ og_include('compose/button.html.j2', {'p': {'Variant': 'ghost', 'Size': 'sm', 'Layout': 'icon', 'Type': 'button', 'AriaLabel': og_s(og_get(v_labels, ['close']))}, 'children': c_2}) }}
  {%- endset -%}
  {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center', 'Justify': 'between'}, 'children': c_3}) }}
  {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_first_of(v_photos, 'title'), 'src': og_first_of(v_photos, 'image'), 'ratio': '4/3'}}) }}
  {%- if og_t(og_eq(v_captions, 'show')) %}
    {%- set c_4 -%}
      {{ og_text(og_first_of(v_photos, 'tag')) }}
    {%- endset -%}
    {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_4}) }}
  {%- endif %}
  {%- set c_9 -%}
    {%- set c_5 -%}
      {{ og_text(og_tpl(og_get(v_labels, ['counter']), [1, og_len(v_photos)])) }}
    {%- endset -%}
    {{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_5}) }}
    {%- set c_8 -%}
      {%- set c_6 -%}
        {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'chevron-left', 'Size': 16}}) }}
      {%- endset -%}
      {{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'sm', 'Layout': 'icon', 'Type': 'button', 'AriaLabel': og_s(og_get(v_labels, ['previous']))}, 'children': c_6}) }}
      {%- set c_7 -%}
        {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'chevron-right', 'Size': 16}}) }}
      {%- endset -%}
      {{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'sm', 'Layout': 'icon', 'Type': 'button', 'AriaLabel': og_s(og_get(v_labels, ['next']))}, 'children': c_7}) }}
    {%- endset -%}
    {{ og_include('compose/group.html.j2', {'p': {'Gap': '2'}, 'children': c_8}) }}
  {%- endset -%}
  {{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center', 'Justify': 'between'}, 'children': c_9}) }}
{%- endset -%}
{{ og_include('compose/dialog.html.j2', {'p': {'Open': og_t(og_eq(v_lightbox, 'open')), 'Size': 'xl', 'AriaLabel': og_s(og_first_of(v_photos, 'title')), 'Class': 'gap-4 p-4', 'Attrs': og_attrs(['data-slot', 'lightbox'])}, 'children': c_10}) }}

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 selected photo in a dialog: title, close, picture, optional caption and previous/next. Static open state. Used by LightboxGallery.

Props of LightboxStage
PropTypeDefault Description
photos (required)Photo[]-
labels (required)LightboxLabels-
captions "show" | "hide""show"
lightbox "open" | "closed""closed"

Used in