Skip to content
ui8kit

block / account

Auth Layout

A whole sign-in page: the card beside a picture panel, on a tinted page, or alone; with any mode of the card.

Install

npx ui8kit add auth-layout

Pulls in: auth-card, block, box, compose, container, grid, kit-box, kit-text, media-frame, stack, text, title, utils

Preview

Welcome back

Sign in to continue to your workspace.

New here? Create an account

Ship pages faster

Blocks, data and checks in one place, so a page is ready when the idea is.

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 auth-layout
blocks/auth-layout.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. -->
<!--
  A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card,
  centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side
  of the picture), mode, social. The page's heading is the card's title.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { AuthSwitch, AuthVisual } from "./auth-layout.types";
  import type { AuthLabels } from "./auth-card.types";

  export type AuthLayoutProps = {
    id: string;
    title: string;
    text: string;
    submit: string;
    switchTo: AuthSwitch;
    labels: AuthLabels;
    visual: AuthVisual;
    level?: 1 | 2;
    layout?: "split" | "centered" | "minimal";
    side?: "end" | "start";
    mode?: "signin" | "signup" | "reset" | "magic";
    social?: "none" | "show" | "first";
    landmarkLabel?: string;
  };
</script>

<script lang="ts">
  import Block from "../compose/Block.svelte";
  import Box from "../compose/Box.svelte";
  import Container from "../compose/Container.svelte";
  import Grid from "../compose/Grid.svelte";
  import Stack from "../compose/Stack.svelte";
  import Text from "../compose/Text.svelte";
  import Title from "../compose/Title.svelte";
  import AuthCard from "../blocks/auth-card.svelte";
  import MediaFrame from "../components/media-frame.svelte";
  import { cn } from "../utils";

  let {
    id,
    title,
    text,
    submit,
    switchTo,
    labels,
    visual,
    level = 1,
    layout = "split",
    side = "end",
    mode = "signin",
    social = "none",
    landmarkLabel,
  }: AuthLayoutProps = $props();
</script>

<Block tag="div" class="w-full" data-layout={layout} data-slot="auth-layout">
  <Container class={cn("mx-auto w-full max-w-6xl px-4", "py-12")} data-slot="container">
    {#if ((layout as string) === "split")}
      <Grid cols="1-2" class="items-stretch gap-8">
        <Box class="mx-auto flex w-full max-w-sm items-center">
          <AuthCard
            id={id}
            title={title}
            text={text}
            submit={submit}
            switchText={switchTo.text}
            switchLink={switchTo.link}
            switchHref={switchTo.href}
            labels={labels}
            mode={mode}
            layout="plain"
            social={social}
            level={level}
            landmarkLabel={landmarkLabel}
          />
        </Box>
        <Stack
          gap="4"
          align="stretch"
          class={cn(
            "justify-end rounded bg-muted p-8",
            (((side as string) === "start") ? "md:order-first" : "md:order-last")
          )}
          data-slot="visual"
        >
          <MediaFrame alt={visual.title} ratio="4/3" />
          <Title as={2} size="2xl" weight="bold">
            {visual.title}
          </Title>
          <Text size="sm" class="text-muted-foreground">
            {visual.text}
          </Text>
        </Stack>
      </Grid>
    {:else if ((layout as string) === "centered")}
      <Box class="mx-auto w-full max-w-md rounded bg-muted p-6">
        <AuthCard
          id={id}
          title={title}
          text={text}
          submit={submit}
          switchText={switchTo.text}
          switchLink={switchTo.link}
          switchHref={switchTo.href}
          labels={labels}
          mode={mode}
          social={social}
          level={level}
          landmarkLabel={landmarkLabel}
        />
      </Box>
    {:else}
      <Box class="mx-auto w-full max-w-sm">
        <AuthCard
          id={id}
          title={title}
          text={text}
          submit={submit}
          switchText={switchTo.text}
          switchLink={switchTo.link}
          switchHref={switchTo.href}
          labels={labels}
          mode={mode}
          layout="plain"
          social={social}
          level={level}
          landmarkLabel={landmarkLabel}
        />
      </Box>
    {/if}
  </Container>
</Block>
blocks/auth-layout.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type AuthSwitch = {
  /** the sentence before the link */
  text: string;
  /** text of the link */
  link: string;
  href?: string;
};

export type AuthVisual = {
  /** the line on the picture panel */
  title: string;
  text: string;
};

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 auth-layout
blocks/auth-layout.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.
/**
 * A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card,
 * centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side
 * of the picture), mode, social. The page's heading is the card's title.
 */
import { type ReactNode } from "react";
import { Block, Box, Container, Grid, Stack, Text, Title } from "../compose";
import { AuthCard } from "../blocks/auth-card";
import { MediaFrame } from "../components/media-frame";
import { cn } from "../utils";
import type { AuthSwitch, AuthVisual } from "./auth-layout.types";
import type { AuthLabels } from "./auth-card.types";

export type AuthLayoutProps = {
  id: string;
  title: string;
  text: string;
  submit: string;
  switchTo: AuthSwitch;
  labels: AuthLabels;
  visual: AuthVisual;
  level?: 1 | 2;
  layout?: "split" | "centered" | "minimal";
  side?: "end" | "start";
  mode?: "signin" | "signup" | "reset" | "magic";
  social?: "none" | "show" | "first";
  landmarkLabel?: string;
};

export function AuthLayout({
  id,
  title,
  text,
  submit,
  switchTo,
  labels,
  visual,
  level = 1,
  layout = "split",
  side = "end",
  mode = "signin",
  social = "none",
  landmarkLabel,
}: AuthLayoutProps) {
  return (
    <Block tag="div" className="w-full" data-layout={layout} data-slot="auth-layout">
      <Container className={cn("mx-auto w-full max-w-6xl px-4", "py-12")} data-slot="container">
        {((layout as string) === "split") ? (
          <Grid cols="1-2" className="items-stretch gap-8">
            <Box className="mx-auto flex w-full max-w-sm items-center">
              <AuthCard
                id={id}
                title={title}
                text={text}
                submit={submit}
                switchText={switchTo.text}
                switchLink={switchTo.link}
                switchHref={switchTo.href}
                labels={labels}
                mode={mode}
                layout="plain"
                social={social}
                level={level}
                landmarkLabel={landmarkLabel}
              />
            </Box>
            <Stack
              gap="4"
              align="stretch"
              className={cn(
                "justify-end rounded bg-muted p-8",
                (((side as string) === "start") ? "md:order-first" : "md:order-last")
              )}
              data-slot="visual"
            >
              <MediaFrame alt={visual.title} ratio="4/3" />
              <Title as={2} size="2xl" weight="bold">
                {visual.title}
              </Title>
              <Text size="sm" className="text-muted-foreground">
                {visual.text}
              </Text>
            </Stack>
          </Grid>
        ) : ((layout as string) === "centered") ? (
          <Box className="mx-auto w-full max-w-md rounded bg-muted p-6">
            <AuthCard
              id={id}
              title={title}
              text={text}
              submit={submit}
              switchText={switchTo.text}
              switchLink={switchTo.link}
              switchHref={switchTo.href}
              labels={labels}
              mode={mode}
              social={social}
              level={level}
              landmarkLabel={landmarkLabel}
            />
          </Box>
        ) : (
          <Box className="mx-auto w-full max-w-sm">
            <AuthCard
              id={id}
              title={title}
              text={text}
              submit={submit}
              switchText={switchTo.text}
              switchLink={switchTo.link}
              switchHref={switchTo.href}
              labels={labels}
              mode={mode}
              layout="plain"
              social={social}
              level={level}
              landmarkLabel={landmarkLabel}
            />
          </Box>
        )}
      </Container>
    </Block>
  );
}
blocks/auth-layout.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type AuthSwitch = {
  /** the sentence before the link */
  text: string;
  /** text of the link */
  link: string;
  href?: string;
};

export type AuthVisual = {
  /** the line on the picture panel */
  title: string;
  text: string;
};

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 auth-layout
blocks/auth-layout.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type AuthSwitch = {
  /** the sentence before the link */
  text: string;
  /** text of the link */
  link: string;
  href?: string;
};

export type AuthVisual = {
  /** the line on the picture panel */
  title: string;
  text: string;
};
blocks/auth-layout.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. -->
<!--
  A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card,
  centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side
  of the picture), mode, social. The page's heading is the card's title.
-->
<script lang="ts">
import type { AuthSwitch, AuthVisual } from "./auth-layout.types";
import type { AuthLabels } from "./auth-card.types";

export type AuthLayoutProps = {
  id: string;
  title: string;
  text: string;
  submit: string;
  switchTo: AuthSwitch;
  labels: AuthLabels;
  visual: AuthVisual;
  level?: 1 | 2;
  layout?: "split" | "centered" | "minimal";
  side?: "end" | "start";
  mode?: "signin" | "signup" | "reset" | "magic";
  social?: "none" | "show" | "first";
  landmarkLabel?: string;
};
</script>

<script setup lang="ts">
import Block from "../compose/Block.vue";
import Box from "../compose/Box.vue";
import Container from "../compose/Container.vue";
import Grid from "../compose/Grid.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import Title from "../compose/Title.vue";
import AuthCard from "../blocks/auth-card.vue";
import MediaFrame from "../components/media-frame.vue";
import { cn } from "../utils";

const {
  id,
  title,
  text,
  submit,
  switchTo,
  labels,
  visual,
  level = 1,
  layout = "split",
  side = "end",
  mode = "signin",
  social = "none",
  landmarkLabel,
} = defineProps<AuthLayoutProps>();
</script>

<template>
  <Block tag="div" class="w-full" :data-layout="layout" data-slot="auth-layout">
    <Container :class="cn('mx-auto w-full max-w-6xl px-4', 'py-12')" data-slot="container">
      <Grid v-if="((layout as string) === 'split')" cols="1-2" class="items-stretch gap-8">
        <Box class="mx-auto flex w-full max-w-sm items-center">
          <AuthCard
            :id="id"
            :title="title"
            :text="text"
            :submit="submit"
            :switchText="switchTo.text"
            :switchLink="switchTo.link"
            :switchHref="switchTo.href"
            :labels="labels"
            :mode="mode"
            layout="plain"
            :social="social"
            :level="level"
            :landmarkLabel="landmarkLabel"
          />
        </Box>
        <Stack
          gap="4"
          align="stretch"
          :class="cn(
            'justify-end rounded bg-muted p-8',
            (((side as string) === 'start') ? 'md:order-first' : 'md:order-last')
          )"
          data-slot="visual"
        >
          <MediaFrame :alt="visual.title" ratio="4/3" />
          <Title :as="2" size="2xl" weight="bold">
            {{ visual.title }}
          </Title>
          <Text size="sm" class="text-muted-foreground">
            {{ visual.text }}
          </Text>
        </Stack>
      </Grid>
      <Box v-else-if="((layout as string) === 'centered')" class="mx-auto w-full max-w-md rounded bg-muted p-6">
        <AuthCard
          :id="id"
          :title="title"
          :text="text"
          :submit="submit"
          :switchText="switchTo.text"
          :switchLink="switchTo.link"
          :switchHref="switchTo.href"
          :labels="labels"
          :mode="mode"
          :social="social"
          :level="level"
          :landmarkLabel="landmarkLabel"
        />
      </Box>
      <Box v-else class="mx-auto w-full max-w-sm">
        <AuthCard
          :id="id"
          :title="title"
          :text="text"
          :submit="submit"
          :switchText="switchTo.text"
          :switchLink="switchTo.link"
          :switchHref="switchTo.href"
          :labels="labels"
          :mode="mode"
          layout="plain"
          :social="social"
          :level="level"
          :landmarkLabel="landmarkLabel"
        />
      </Box>
    </Container>
  </Block>
</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 auth-layout
blocks/auth-layout.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.
/**
 * A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card,
 * centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side
 * of the picture), mode, social. The page's heading is the card's title.
 */
import { type JSX } from "solid-js";
import { Block, Box, Container, Grid, Stack, Text, Title } from "../compose";
import { AuthCard } from "../blocks/auth-card";
import { MediaFrame } from "../components/media-frame";
import { cn } from "../utils";
import type { AuthSwitch, AuthVisual } from "./auth-layout.types";
import type { AuthLabels } from "./auth-card.types";

export type AuthLayoutProps = {
  id: string;
  title: string;
  text: string;
  submit: string;
  switchTo: AuthSwitch;
  labels: AuthLabels;
  visual: AuthVisual;
  level?: 1 | 2;
  layout?: "split" | "centered" | "minimal";
  side?: "end" | "start";
  mode?: "signin" | "signup" | "reset" | "magic";
  social?: "none" | "show" | "first";
  landmarkLabel?: string;
};

export function AuthLayout({
  id,
  title,
  text,
  submit,
  switchTo,
  labels,
  visual,
  level = 1,
  layout = "split",
  side = "end",
  mode = "signin",
  social = "none",
  landmarkLabel,
}: AuthLayoutProps) {
  return (
    <Block tag="div" class="w-full" data-layout={layout} data-slot="auth-layout">
      <Container class={cn("mx-auto w-full max-w-6xl px-4", "py-12")} data-slot="container">
        {((layout as string) === "split") ? (
          <Grid cols="1-2" class="items-stretch gap-8">
            <Box class="mx-auto flex w-full max-w-sm items-center">
              <AuthCard
                id={id}
                title={title}
                text={text}
                submit={submit}
                switchText={switchTo.text}
                switchLink={switchTo.link}
                switchHref={switchTo.href}
                labels={labels}
                mode={mode}
                layout="plain"
                social={social}
                level={level}
                landmarkLabel={landmarkLabel}
              />
            </Box>
            <Stack
              gap="4"
              align="stretch"
              class={cn(
                "justify-end rounded bg-muted p-8",
                (((side as string) === "start") ? "md:order-first" : "md:order-last")
              )}
              data-slot="visual"
            >
              <MediaFrame alt={visual.title} ratio="4/3" />
              <Title as={2} size="2xl" weight="bold">
                {visual.title}
              </Title>
              <Text size="sm" class="text-muted-foreground">
                {visual.text}
              </Text>
            </Stack>
          </Grid>
        ) : ((layout as string) === "centered") ? (
          <Box class="mx-auto w-full max-w-md rounded bg-muted p-6">
            <AuthCard
              id={id}
              title={title}
              text={text}
              submit={submit}
              switchText={switchTo.text}
              switchLink={switchTo.link}
              switchHref={switchTo.href}
              labels={labels}
              mode={mode}
              social={social}
              level={level}
              landmarkLabel={landmarkLabel}
            />
          </Box>
        ) : (
          <Box class="mx-auto w-full max-w-sm">
            <AuthCard
              id={id}
              title={title}
              text={text}
              submit={submit}
              switchText={switchTo.text}
              switchLink={switchTo.link}
              switchHref={switchTo.href}
              labels={labels}
              mode={mode}
              layout="plain"
              social={social}
              level={level}
              landmarkLabel={landmarkLabel}
            />
          </Box>
        )}
      </Container>
    </Block>
  );
}
blocks/auth-layout.types.ts
// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.

export type AuthSwitch = {
  /** the sentence before the link */
  text: string;
  /** text of the link */
  link: string;
  href?: string;
};

export type AuthVisual = {
  /** the line on the picture panel */
  title: string;
  text: string;
};

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 auth-layout
blocks/auth-layout.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/auth-layout.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/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// AuthLayoutProps are the props of AuthLayout; the values are the JSON shapes of the TypeScript props.
type AuthLayoutProps struct {
	Id any `json:"id"`
	Title any `json:"title"`
	Text any `json:"text"`
	Submit any `json:"submit"`
	SwitchTo any `json:"switchTo"`
	Labels any `json:"labels"`
	Visual any `json:"visual"`
	Level any `json:"level"`
	Layout any `json:"layout"`
	Side any `json:"side"`
	Mode any `json:"mode"`
	Social any `json:"social"`
	LandmarkLabel any `json:"landmarkLabel"`
}

// A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card, centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side of the picture), mode, social. The page's heading is the card's title.
templ AuthLayout(p AuthLayoutProps) {
	{{ vId := p.Id }}
	{{ vTitle := p.Title }}
	{{ vText := p.Text }}
	{{ vSubmit := p.Submit }}
	{{ vSwitchTo := p.SwitchTo }}
	{{ vLabels := p.Labels }}
	{{ vVisual := p.Visual }}
	{{ vLevel := uiutils.Def(p.Level, float64(1)) }}
	{{ vLayout := uiutils.Def(p.Layout, "split") }}
	{{ vSide := uiutils.Def(p.Side, "end") }}
	{{ vMode := uiutils.Def(p.Mode, "signin") }}
	{{ vSocial := uiutils.Def(p.Social, "none") }}
	{{ vLandmarkLabel := p.LandmarkLabel }}
	@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "div", Class: "w-full", Attrs: uiutils.Attrs("data-layout", vLayout, "data-slot", "auth-layout")}}) {
		@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("mx-auto w-full max-w-6xl px-4", "py-12")), Attrs: uiutils.Attrs("data-slot", "container")}}) {
			if uiutils.Eq(vLayout, "split") {
				@compose.Grid(compose.GridProps{Cols: "1-2", BoxProps: box.BoxProps{Class: "items-stretch gap-8"}}) {
					@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "mx-auto flex w-full max-w-sm items-center"}}) {
						@AuthCard(AuthCardProps{Id: vId, Title: vTitle, Text: vText, Submit: vSubmit, SwitchText: uiutils.Get(vSwitchTo, "text"), SwitchLink: uiutils.Get(vSwitchTo, "link"), SwitchHref: uiutils.Get(vSwitchTo, "href"), Labels: vLabels, Mode: vMode, Layout: "plain", Social: vSocial, Level: vLevel, LandmarkLabel: vLandmarkLabel})
					}
					@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("justify-end rounded bg-muted p-8", uiutils.Cond(uiutils.T(uiutils.Eq(vSide, "start")), "md:order-first", "md:order-last"))), Attrs: uiutils.Attrs("data-slot", "visual")}}) {
						@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vVisual, "title"), Ratio: "4/3"})
						@compose.Title(compose.TitleProps{As: "2", Size: "2xl", Weight: "bold", TextProps: text.TextProps{}}) {
							{ uiutils.Text(uiutils.Get(vVisual, "title")) }
						}
						@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
							{ uiutils.Text(uiutils.Get(vVisual, "text")) }
						}
					}
				}
			} else if uiutils.Eq(vLayout, "centered") {
				@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "mx-auto w-full max-w-md rounded bg-muted p-6"}}) {
					@AuthCard(AuthCardProps{Id: vId, Title: vTitle, Text: vText, Submit: vSubmit, SwitchText: uiutils.Get(vSwitchTo, "text"), SwitchLink: uiutils.Get(vSwitchTo, "link"), SwitchHref: uiutils.Get(vSwitchTo, "href"), Labels: vLabels, Mode: vMode, Social: vSocial, Level: vLevel, LandmarkLabel: vLandmarkLabel})
				}
			} else {
				@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: "mx-auto w-full max-w-sm"}}) {
					@AuthCard(AuthCardProps{Id: vId, Title: vTitle, Text: vText, Submit: vSubmit, SwitchText: uiutils.Get(vSwitchTo, "text"), SwitchLink: uiutils.Get(vSwitchTo, "link"), SwitchHref: uiutils.Get(vSwitchTo, "href"), Labels: vLabels, Mode: vMode, Layout: "plain", Social: vSocial, Level: vLevel, LandmarkLabel: vLandmarkLabel})
				}
			}
		}
	}
}

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 auth-layout
blocks/auth-layout.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/auth-layout.json
    A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card, centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side of the picture), mode, social. The page's heading is the card's title.
    Props (p): id, title, text, submit, switchTo, labels, visual, level, layout, side, mode, social, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_text = (p.text ?? null) -%}
{%- set v_submit = (p.submit ?? null) -%}
{%- set v_switchTo = (p.switchTo ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_visual = (p.visual ?? null) -%}
{%- set v_level = (p.level ?? 1) -%}
{%- set v_layout = (p.layout ?? 'split') -%}
{%- set v_side = (p.side ?? 'end') -%}
{%- set v_mode = (p.mode ?? 'signin') -%}
{%- set v_social = (p.social ?? 'none') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_9 -%}
  {%- set c_8 -%}
    {%- if og_t(og_eq(v_layout, 'split')) %}
      {%- set c_5 -%}
        {%- set c_1 -%}
          {{ include('blocks/auth-card.html.twig', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'submit': v_submit, 'switchText': og_get(v_switchTo, ['text']), 'switchLink': og_get(v_switchTo, ['link']), 'switchHref': og_get(v_switchTo, ['href']), 'labels': v_labels, 'mode': v_mode, 'layout': 'plain', 'social': v_social, 'level': v_level, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Box.html.twig', {'class': 'mx-auto flex w-full max-w-sm items-center', 'children': c_1}, with_context = false) }}
        {%- set c_4 -%}
          {{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_visual, ['title']), 'ratio': '4/3'}}, with_context = false) }}
          {%- set c_2 -%}
            {{ og_text(og_get(v_visual, ['title'])) }}
          {%- endset -%}
          {{ include('compose/Title.html.twig', {'as': 2, 'size': '2xl', 'weight': 'bold', 'children': c_2}, with_context = false) }}
          {%- set c_3 -%}
            {{ og_text(og_get(v_visual, ['text'])) }}
          {%- endset -%}
          {{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_3}, with_context = false) }}
        {%- endset -%}
        {{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': og_s(og_cnv(['justify-end rounded bg-muted p-8', (og_t(og_eq(v_side, 'start')) ? 'md:order-first' : 'md:order-last')])), 'attrs': og_attrs(['data-slot', 'visual']), 'children': c_4}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Grid.html.twig', {'cols': '1-2', 'class': 'items-stretch gap-8', 'children': c_5}, with_context = false) }}
    {%- elseif og_t(og_eq(v_layout, 'centered')) %}
      {%- set c_6 -%}
        {{ include('blocks/auth-card.html.twig', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'submit': v_submit, 'switchText': og_get(v_switchTo, ['text']), 'switchLink': og_get(v_switchTo, ['link']), 'switchHref': og_get(v_switchTo, ['href']), 'labels': v_labels, 'mode': v_mode, 'social': v_social, 'level': v_level, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Box.html.twig', {'class': 'mx-auto w-full max-w-md rounded bg-muted p-6', 'children': c_6}, with_context = false) }}
    {%- else %}
      {%- set c_7 -%}
        {{ include('blocks/auth-card.html.twig', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'submit': v_submit, 'switchText': og_get(v_switchTo, ['text']), 'switchLink': og_get(v_switchTo, ['link']), 'switchHref': og_get(v_switchTo, ['href']), 'labels': v_labels, 'mode': v_mode, 'layout': 'plain', 'social': v_social, 'level': v_level, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Box.html.twig', {'class': 'mx-auto w-full max-w-sm', 'children': c_7}, with_context = false) }}
    {%- endif %}
  {%- endset -%}
  {{ include('compose/Container.html.twig', {'class': og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'py-12'])), 'attrs': og_attrs(['data-slot', 'container']), 'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'div', 'class': 'w-full', 'attrs': og_attrs(['data-layout', v_layout, 'data-slot', 'auth-layout']), 'children': c_9}, 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 auth-layout
blocks/auth-layout.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/auth-layout.json
    A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card, centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side of the picture), mode, social. The page's heading is the card's title.
    Props (p): id, title, text, submit, switchTo, labels, visual, level, layout, side, mode, social, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_text = ($p['text'] ?? null)}
{var $v_submit = ($p['submit'] ?? null)}
{var $v_switchTo = ($p['switchTo'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_visual = ($p['visual'] ?? null)}
{var $v_level = ($p['level'] ?? 1)}
{var $v_layout = ($p['layout'] ?? 'split')}
{var $v_side = ($p['side'] ?? 'end')}
{var $v_mode = ($p['mode'] ?? 'signin')}
{var $v_social = ($p['social'] ?? 'none')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_9}
  {capture $c_8}
    {if og_t(og_eq($v_layout, 'split'))}
      {capture $c_5}
        {capture $c_1}
          {=og_include('blocks/auth-card.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'text' => $v_text, 'submit' => $v_submit, 'switchText' => og_get($v_switchTo, ['text']), 'switchLink' => og_get($v_switchTo, ['link']), 'switchHref' => og_get($v_switchTo, ['href']), 'labels' => $v_labels, 'mode' => $v_mode, 'layout' => 'plain', 'social' => $v_social, 'level' => $v_level, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
        {/capture}
        {=og_include('compose/Box.latte', ['class' => 'mx-auto flex w-full max-w-sm items-center', 'children' => (string) $c_1])|noescape}
        {capture $c_4}
          {=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_visual, ['title']), 'ratio' => '4/3']])|noescape}
          {capture $c_2}
            {=og_text(og_get($v_visual, ['title']))}
          {/capture}
          {=og_include('compose/Title.latte', ['as' => 2, 'size' => '2xl', 'weight' => 'bold', 'children' => (string) $c_2])|noescape}
          {capture $c_3}
            {=og_text(og_get($v_visual, ['text']))}
          {/capture}
          {=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_3])|noescape}
        {/capture}
        {=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => og_s(og_cnv(['justify-end rounded bg-muted p-8', (og_t(og_eq($v_side, 'start')) ? 'md:order-first' : 'md:order-last')])), 'attrs' => og_attrs(['data-slot', 'visual']), 'children' => (string) $c_4])|noescape}
      {/capture}
      {=og_include('compose/Grid.latte', ['cols' => '1-2', 'class' => 'items-stretch gap-8', 'children' => (string) $c_5])|noescape}
    {elseif og_t(og_eq($v_layout, 'centered'))}
      {capture $c_6}
        {=og_include('blocks/auth-card.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'text' => $v_text, 'submit' => $v_submit, 'switchText' => og_get($v_switchTo, ['text']), 'switchLink' => og_get($v_switchTo, ['link']), 'switchHref' => og_get($v_switchTo, ['href']), 'labels' => $v_labels, 'mode' => $v_mode, 'social' => $v_social, 'level' => $v_level, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
      {/capture}
      {=og_include('compose/Box.latte', ['class' => 'mx-auto w-full max-w-md rounded bg-muted p-6', 'children' => (string) $c_6])|noescape}
    {else}
      {capture $c_7}
        {=og_include('blocks/auth-card.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'text' => $v_text, 'submit' => $v_submit, 'switchText' => og_get($v_switchTo, ['text']), 'switchLink' => og_get($v_switchTo, ['link']), 'switchHref' => og_get($v_switchTo, ['href']), 'labels' => $v_labels, 'mode' => $v_mode, 'layout' => 'plain', 'social' => $v_social, 'level' => $v_level, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
      {/capture}
      {=og_include('compose/Box.latte', ['class' => 'mx-auto w-full max-w-sm', 'children' => (string) $c_7])|noescape}
    {/if}
  {/capture}
  {=og_include('compose/Container.latte', ['class' => og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'py-12'])), 'attrs' => og_attrs(['data-slot', 'container']), 'children' => (string) $c_8])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'div', 'class' => 'w-full', 'attrs' => og_attrs(['data-layout', $v_layout, 'data-slot', 'auth-layout']), 'children' => (string) $c_9])|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 auth-layout
blocks/auth-layout.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/auth-layout.json
    A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card, centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side of the picture), mode, social. The page's heading is the card's title.
    Props (p): id, title, text, submit, switchTo, labels, visual, level, layout, side, mode, social, 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_submit = og_def(p['submit'], none) -%}
{%- set v_switchTo = og_def(p['switchTo'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_visual = og_def(p['visual'], none) -%}
{%- set v_level = og_def(p['level'], 1) -%}
{%- set v_layout = og_def(p['layout'], 'split') -%}
{%- set v_side = og_def(p['side'], 'end') -%}
{%- set v_mode = og_def(p['mode'], 'signin') -%}
{%- set v_social = og_def(p['social'], 'none') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_9 -%}
  {%- set c_8 -%}
    {%- if og_t(og_eq(v_layout, 'split')) %}
      {%- set c_5 -%}
        {%- set c_1 -%}
          {{ og_include('blocks/auth-card.html.j2', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'submit': v_submit, 'switchText': og_get(v_switchTo, ['text']), 'switchLink': og_get(v_switchTo, ['link']), 'switchHref': og_get(v_switchTo, ['href']), 'labels': v_labels, 'mode': v_mode, 'layout': 'plain', 'social': v_social, 'level': v_level, 'landmarkLabel': v_landmarkLabel}}) }}
        {%- endset -%}
        {{ og_include('compose/box.html.j2', {'p': {'Class': 'mx-auto flex w-full max-w-sm items-center'}, 'children': c_1}) }}
        {%- set c_4 -%}
          {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_visual, ['title']), 'ratio': '4/3'}}) }}
          {%- set c_2 -%}
            {{ og_text(og_get(v_visual, ['title'])) }}
          {%- endset -%}
          {{ og_include('compose/title.html.j2', {'p': {'As': 2, 'Size': '2xl', 'Weight': 'bold'}, 'children': c_2}) }}
          {%- set c_3 -%}
            {{ og_text(og_get(v_visual, ['text'])) }}
          {%- endset -%}
          {{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_3}) }}
        {%- endset -%}
        {{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': og_s(og_cnv(['justify-end rounded bg-muted p-8', ('md:order-first' if og_t(og_eq(v_side, 'start')) else 'md:order-last')])), 'Attrs': og_attrs(['data-slot', 'visual'])}, 'children': c_4}) }}
      {%- endset -%}
      {{ og_include('compose/grid.html.j2', {'p': {'Cols': '1-2', 'Class': 'items-stretch gap-8'}, 'children': c_5}) }}
    {%- elif og_t(og_eq(v_layout, 'centered')) %}
      {%- set c_6 -%}
        {{ og_include('blocks/auth-card.html.j2', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'submit': v_submit, 'switchText': og_get(v_switchTo, ['text']), 'switchLink': og_get(v_switchTo, ['link']), 'switchHref': og_get(v_switchTo, ['href']), 'labels': v_labels, 'mode': v_mode, 'social': v_social, 'level': v_level, 'landmarkLabel': v_landmarkLabel}}) }}
      {%- endset -%}
      {{ og_include('compose/box.html.j2', {'p': {'Class': 'mx-auto w-full max-w-md rounded bg-muted p-6'}, 'children': c_6}) }}
    {%- else %}
      {%- set c_7 -%}
        {{ og_include('blocks/auth-card.html.j2', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'submit': v_submit, 'switchText': og_get(v_switchTo, ['text']), 'switchLink': og_get(v_switchTo, ['link']), 'switchHref': og_get(v_switchTo, ['href']), 'labels': v_labels, 'mode': v_mode, 'layout': 'plain', 'social': v_social, 'level': v_level, 'landmarkLabel': v_landmarkLabel}}) }}
      {%- endset -%}
      {{ og_include('compose/box.html.j2', {'p': {'Class': 'mx-auto w-full max-w-sm'}, 'children': c_7}) }}
    {%- endif %}
  {%- endset -%}
  {{ og_include('compose/container.html.j2', {'p': {'Class': og_s(og_cnv(['mx-auto w-full max-w-6xl px-4', 'py-12'])), 'Attrs': og_attrs(['data-slot', 'container'])}, 'children': c_8}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'div', 'Class': 'w-full', 'Attrs': og_attrs(['data-layout', v_layout, 'data-slot', 'auth-layout'])}, 'children': c_9}) }}

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.

A whole sign-in page: the AuthCard placed in the page. Axes: layout (split: a picture panel beside the card, centered: the card on a tinted page, minimal: the card alone in a narrow column), side (end, start: the side of the picture), mode, social. The page's heading is the card's title.

Props of AuthLayout
PropTypeDefault Description
id (required)string-
title (required)string-
text (required)string-
submit (required)string-
switchTo (required)AuthSwitch-the way to the other mode (sign up instead, sign in instead)
labels (required)AuthLabels-
visual (required)AuthVisual-the picture panel of layout split
level 1 | 21
layout "split" | "centered" | "minimal""split"
side "end" | "start""end"
mode "signin" | "signup" | "reset" | "magic""signin"
social "none" | "show" | "first""none"
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