Auth Card
Sign in, sign up and reset password.
Install
npx ui8kit add auth-cardPulls in: auth-form, block, button, compose, group, kit-box, kit-button, kit-link, kit-separator, kit-text, link, lucide-icon, separator, stack, text, title, utils
Preview
Welcome back
Sign in to continue to your workspace.
New here? Create an account
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 auth-card<!-- 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 sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button,
optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout
(card, plain), social (none, show).
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { AuthLabels } from "./auth-card.types";
export type AuthCardProps = {
id: string;
title: string;
text: string;
submit: string;
switchText: string;
switchLink: string;
switchHref?: string;
labels: AuthLabels;
mode?: "signin" | "signup" | "reset" | "magic";
layout?: "card" | "plain";
social?: "none" | "show" | "first";
level?: 1 | 2;
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 Link from "../compose/Link.svelte";
import LucideIcon from "../icons/LucideIcon.svelte";
import Separator from "../compose/Separator.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import Title from "../compose/Title.svelte";
import AuthForm from "../components/auth-form.svelte";
import { cn, tpl, urlOf } from "../utils";
let {
id,
title,
text,
submit,
switchText,
switchLink,
switchHref,
labels,
mode = "signin",
layout = "card",
social = "none",
level = 2,
landmarkLabel,
}: AuthCardProps = $props();
</script>
<Block
tag="section"
class={cn(
"flex w-full flex-col gap-6",
(((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")
)}
aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
data-mode={mode}
aria-label={landmarkLabel}
data-slot="auth-card"
>
<Stack gap="2">
<Title as={level} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
{title}
</Title>
<Text size="sm" class="text-muted-foreground">
{text}
</Text>
</Stack>
{#if (((social as string) === "first") && ((social as string) !== "none") && ((mode as string) !== "reset") && ((mode as string) !== "magic"))}
<Stack gap="4" data-slot="social">
<Group gap="4" align="center">
<Separator class="flex-1" />
<Text size="xs" class="text-muted-foreground">
{labels.divider}
</Text>
<Separator class="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="key-round" size={16} />
{labels.passkey}
</Button>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="mail" size={16} />
{labels.magic}
</Button>
</Stack>
{/if}
<AuthForm id={id} mode={mode} labels={labels} submit={submit} />
{#if (((social as string) !== "first") && ((social as string) !== "none") && ((mode as string) !== "reset") && ((mode as string) !== "magic"))}
<Stack gap="4" data-slot="social">
<Group gap="4" align="center">
<Separator class="flex-1" />
<Text size="xs" class="text-muted-foreground">
{labels.divider}
</Text>
<Separator class="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="key-round" size={16} />
{labels.passkey}
</Button>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="mail" size={16} />
{labels.magic}
</Button>
</Stack>
{/if}
<Text size="sm" class="text-center text-muted-foreground">
{switchText}
{" "}
<Link href={urlOf(switchHref)} variant="default" data-slot="switch">
{switchLink}
</Link>
</Text>
</Block>
// 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 AuthLabels = {
name: string;
email: string;
password: string;
remember: string;
forgot: string;
terms: string;
divider: string;
passkey: string;
magic: string;
};
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 auth-card// 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 sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button,
* optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout
* (card, plain), social (none, show).
*/
import { type ReactNode } from "react";
import { Block, Button, Group, Link, Separator, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { AuthForm } from "../components/auth-form";
import { cn, tpl, urlOf } from "../utils";
import type { AuthLabels } from "./auth-card.types";
export type AuthCardProps = {
id: string;
title: string;
text: string;
submit: string;
switchText: string;
switchLink: string;
switchHref?: string;
labels: AuthLabels;
mode?: "signin" | "signup" | "reset" | "magic";
layout?: "card" | "plain";
social?: "none" | "show" | "first";
level?: 1 | 2;
landmarkLabel?: string;
};
export function AuthCard({
id,
title,
text,
submit,
switchText,
switchLink,
switchHref,
labels,
mode = "signin",
layout = "card",
social = "none",
level = 2,
landmarkLabel,
}: AuthCardProps) {
return (
<Block
tag="section"
className={cn(
"flex w-full flex-col gap-6",
(((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")
)}
aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
data-mode={mode}
aria-label={landmarkLabel}
data-slot="auth-card"
>
<Stack gap="2">
<Title as={level} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
{title}
</Title>
<Text size="sm" className="text-muted-foreground">
{text}
</Text>
</Stack>
{(((social as string) === "first") && ((social as string) !== "none") && ((mode as string) !== "reset") && ((mode as string) !== "magic")) ? (
<Stack gap="4" data-slot="social">
<Group gap="4" align="center">
<Separator className="flex-1" />
<Text size="xs" className="text-muted-foreground">
{labels.divider}
</Text>
<Separator className="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" className="w-full">
<LucideIcon name="key-round" size={16} />
{labels.passkey}
</Button>
<Button variant="outline" size="default" type="button" className="w-full">
<LucideIcon name="mail" size={16} />
{labels.magic}
</Button>
</Stack>
) : null}
<AuthForm id={id} mode={mode} labels={labels} submit={submit} />
{(((social as string) !== "first") && ((social as string) !== "none") && ((mode as string) !== "reset") && ((mode as string) !== "magic")) ? (
<Stack gap="4" data-slot="social">
<Group gap="4" align="center">
<Separator className="flex-1" />
<Text size="xs" className="text-muted-foreground">
{labels.divider}
</Text>
<Separator className="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" className="w-full">
<LucideIcon name="key-round" size={16} />
{labels.passkey}
</Button>
<Button variant="outline" size="default" type="button" className="w-full">
<LucideIcon name="mail" size={16} />
{labels.magic}
</Button>
</Stack>
) : null}
<Text size="sm" className="text-center text-muted-foreground">
{switchText}
{" "}
<Link href={urlOf(switchHref)} variant="default" data-slot="switch">
{switchLink}
</Link>
</Text>
</Block>
);
}
// 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 AuthLabels = {
name: string;
email: string;
password: string;
remember: string;
forgot: string;
terms: string;
divider: string;
passkey: string;
magic: string;
};
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 auth-card// 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 AuthLabels = {
name: string;
email: string;
password: string;
remember: string;
forgot: string;
terms: string;
divider: string;
passkey: string;
magic: string;
};
<!-- 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 sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button,
optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout
(card, plain), social (none, show).
-->
<script lang="ts">
import type { AuthLabels } from "./auth-card.types";
export type AuthCardProps = {
id: string;
title: string;
text: string;
submit: string;
switchText: string;
switchLink: string;
switchHref?: string;
labels: AuthLabels;
mode?: "signin" | "signup" | "reset" | "magic";
layout?: "card" | "plain";
social?: "none" | "show" | "first";
level?: 1 | 2;
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 Link from "../compose/Link.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Separator from "../compose/Separator.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import Title from "../compose/Title.vue";
import AuthForm from "../components/auth-form.vue";
import { cn, tpl, urlOf } from "../utils";
const {
id,
title,
text,
submit,
switchText,
switchLink,
switchHref,
labels,
mode = "signin",
layout = "card",
social = "none",
level = 2,
landmarkLabel,
} = defineProps<AuthCardProps>();
</script>
<template>
<Block
tag="section"
:class="cn(
'flex w-full flex-col gap-6',
(((layout as string) === 'card') ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')
)"
:aria-labelledby="(landmarkLabel ? undefined : tpl('{0}-title', id))"
:data-mode="mode"
:aria-label="landmarkLabel"
data-slot="auth-card"
>
<Stack gap="2">
<Title :as="level" size="2xl" weight="bold" :id="tpl('{0}-title', id)">
{{ title }}
</Title>
<Text size="sm" class="text-muted-foreground">
{{ text }}
</Text>
</Stack>
<Stack
v-if="(((social as string) === 'first') && ((social as string) !== 'none') && ((mode as string) !== 'reset') && ((mode as string) !== 'magic'))"
gap="4"
data-slot="social"
>
<Group gap="4" align="center">
<Separator class="flex-1" />
<Text size="xs" class="text-muted-foreground">
{{ labels.divider }}
</Text>
<Separator class="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="key-round" :size="16" />
{{ labels.passkey }}
</Button>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="mail" :size="16" />
{{ labels.magic }}
</Button>
</Stack>
<AuthForm :id="id" :mode="mode" :labels="labels" :submit="submit" />
<Stack
v-if="(((social as string) !== 'first') && ((social as string) !== 'none') && ((mode as string) !== 'reset') && ((mode as string) !== 'magic'))"
gap="4"
data-slot="social"
>
<Group gap="4" align="center">
<Separator class="flex-1" />
<Text size="xs" class="text-muted-foreground">
{{ labels.divider }}
</Text>
<Separator class="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="key-round" :size="16" />
{{ labels.passkey }}
</Button>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="mail" :size="16" />
{{ labels.magic }}
</Button>
</Stack>
<Text size="sm" class="text-center text-muted-foreground">
{{ switchText }}
{{ " " }}
<Link :href="urlOf(switchHref)" variant="default" data-slot="switch">
{{ switchLink }}
</Link>
</Text>
</Block>
</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 auth-card// 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 sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button,
* optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout
* (card, plain), social (none, show).
*/
import { type JSX } from "solid-js";
import { Block, Button, Group, Link, Separator, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { AuthForm } from "../components/auth-form";
import { cn, tpl, urlOf } from "../utils";
import type { AuthLabels } from "./auth-card.types";
export type AuthCardProps = {
id: string;
title: string;
text: string;
submit: string;
switchText: string;
switchLink: string;
switchHref?: string;
labels: AuthLabels;
mode?: "signin" | "signup" | "reset" | "magic";
layout?: "card" | "plain";
social?: "none" | "show" | "first";
level?: 1 | 2;
landmarkLabel?: string;
};
export function AuthCard({
id,
title,
text,
submit,
switchText,
switchLink,
switchHref,
labels,
mode = "signin",
layout = "card",
social = "none",
level = 2,
landmarkLabel,
}: AuthCardProps) {
return (
<Block
tag="section"
class={cn(
"flex w-full flex-col gap-6",
(((layout as string) === "card") ? "rounded bg-card p-6 inset-ring inset-ring-border" : "")
)}
aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
data-mode={mode}
aria-label={landmarkLabel}
data-slot="auth-card"
>
<Stack gap="2">
<Title as={level} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
{title}
</Title>
<Text size="sm" class="text-muted-foreground">
{text}
</Text>
</Stack>
{(((social as string) === "first") && ((social as string) !== "none") && ((mode as string) !== "reset") && ((mode as string) !== "magic")) ? (
<Stack gap="4" data-slot="social">
<Group gap="4" align="center">
<Separator class="flex-1" />
<Text size="xs" class="text-muted-foreground">
{labels.divider}
</Text>
<Separator class="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="key-round" size={16} />
{labels.passkey}
</Button>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="mail" size={16} />
{labels.magic}
</Button>
</Stack>
) : null}
<AuthForm id={id} mode={mode} labels={labels} submit={submit} />
{(((social as string) !== "first") && ((social as string) !== "none") && ((mode as string) !== "reset") && ((mode as string) !== "magic")) ? (
<Stack gap="4" data-slot="social">
<Group gap="4" align="center">
<Separator class="flex-1" />
<Text size="xs" class="text-muted-foreground">
{labels.divider}
</Text>
<Separator class="flex-1" />
</Group>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="key-round" size={16} />
{labels.passkey}
</Button>
<Button variant="outline" size="default" type="button" class="w-full">
<LucideIcon name="mail" size={16} />
{labels.magic}
</Button>
</Stack>
) : null}
<Text size="sm" class="text-center text-muted-foreground">
{switchText}
{" "}
<Link href={urlOf(switchHref)} variant="default" data-slot="switch">
{switchLink}
</Link>
</Text>
</Block>
);
}
// 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 AuthLabels = {
name: string;
email: string;
password: string;
remember: string;
forgot: string;
terms: string;
divider: string;
passkey: string;
magic: string;
};
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 auth-card// 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-card.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/icons"
"github.com/ui8kit/codegen/generated/templ/ui/link"
"github.com/ui8kit/codegen/generated/templ/ui/separator"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// AuthCardProps are the props of AuthCard; the values are the JSON shapes of the TypeScript props.
type AuthCardProps struct {
Id any `json:"id"`
Title any `json:"title"`
Text any `json:"text"`
Submit any `json:"submit"`
SwitchText any `json:"switchText"`
SwitchLink any `json:"switchLink"`
SwitchHref any `json:"switchHref"`
Labels any `json:"labels"`
Mode any `json:"mode"`
Layout any `json:"layout"`
Social any `json:"social"`
Level any `json:"level"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button, optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout (card, plain), social (none, show).
templ AuthCard(p AuthCardProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vText := p.Text }}
{{ vSubmit := p.Submit }}
{{ vSwitchText := p.SwitchText }}
{{ vSwitchLink := p.SwitchLink }}
{{ vSwitchHref := p.SwitchHref }}
{{ vLabels := p.Labels }}
{{ vMode := uiutils.Def(p.Mode, "signin") }}
{{ vLayout := uiutils.Def(p.Layout, "card") }}
{{ vSocial := uiutils.Def(p.Social, "none") }}
{{ vLevel := uiutils.Def(p.Level, float64(2)) }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "section", Class: uiutils.S(uiutils.Cnv("flex w-full flex-col gap-6", uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "card")), "rounded bg-card p-6 inset-ring inset-ring-border", ""))), Attrs: uiutils.Attrs("aria-labelledby", uiutils.Cond(uiutils.T(vLandmarkLabel), nil, uiutils.Tpl("{0}-title", vId)), "data-mode", vMode, "aria-label", vLandmarkLabel, "data-slot", "auth-card")}}) {
@compose.Stack(compose.StackProps{Gap: "2", BoxProps: box.BoxProps{}}) {
@compose.Title(compose.TitleProps{As: uiutils.S(vLevel), Size: "2xl", Weight: "bold", TextProps: text.TextProps{Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-title", vId))}}) {
{ uiutils.Text(vTitle) }
}
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(vText) }
}
}
if uiutils.T(uiutils.And(uiutils.Eq(vSocial, "first"), !uiutils.Eq(vSocial, "none"), !uiutils.Eq(vMode, "reset"), !uiutils.Eq(vMode, "magic"))) {
@compose.Stack(compose.StackProps{Gap: "4", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "social")}}) {
@compose.Group(compose.GroupProps{Gap: "4", Align: "center", BoxProps: box.BoxProps{}}) {
@compose.Separator(compose.SeparatorProps{SeparatorProps: separator.SeparatorProps{Class: "flex-1"}})
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "divider")) }
}
@compose.Separator(compose.SeparatorProps{SeparatorProps: separator.SeparatorProps{Class: "flex-1"}})
}
@compose.Button(compose.ButtonProps{Variant: "outline", Size: "default", ButtonProps: button.ButtonProps{Type: "button", Class: "w-full"}}) {
@icons.LucideIcon(icons.LucideIconProps{Name: "key-round", Size: 16})
{ uiutils.Text(uiutils.Get(vLabels, "passkey")) }
}
@compose.Button(compose.ButtonProps{Variant: "outline", Size: "default", ButtonProps: button.ButtonProps{Type: "button", Class: "w-full"}}) {
@icons.LucideIcon(icons.LucideIconProps{Name: "mail", Size: 16})
{ uiutils.Text(uiutils.Get(vLabels, "magic")) }
}
}
}
@AuthForm(AuthFormProps{Id: vId, Mode: vMode, Labels: vLabels, Submit: vSubmit})
if uiutils.T(uiutils.And(!uiutils.Eq(vSocial, "first"), !uiutils.Eq(vSocial, "none"), !uiutils.Eq(vMode, "reset"), !uiutils.Eq(vMode, "magic"))) {
@compose.Stack(compose.StackProps{Gap: "4", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "social")}}) {
@compose.Group(compose.GroupProps{Gap: "4", Align: "center", BoxProps: box.BoxProps{}}) {
@compose.Separator(compose.SeparatorProps{SeparatorProps: separator.SeparatorProps{Class: "flex-1"}})
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "divider")) }
}
@compose.Separator(compose.SeparatorProps{SeparatorProps: separator.SeparatorProps{Class: "flex-1"}})
}
@compose.Button(compose.ButtonProps{Variant: "outline", Size: "default", ButtonProps: button.ButtonProps{Type: "button", Class: "w-full"}}) {
@icons.LucideIcon(icons.LucideIconProps{Name: "key-round", Size: 16})
{ uiutils.Text(uiutils.Get(vLabels, "passkey")) }
}
@compose.Button(compose.ButtonProps{Variant: "outline", Size: "default", ButtonProps: button.ButtonProps{Type: "button", Class: "w-full"}}) {
@icons.LucideIcon(icons.LucideIconProps{Name: "mail", Size: 16})
{ uiutils.Text(uiutils.Get(vLabels, "magic")) }
}
}
}
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-center text-muted-foreground"}}) {
{ uiutils.Text(vSwitchText) }
{ uiutils.Text(" ") }
@compose.Link(compose.LinkProps{Variant: "default", LinkProps: link.LinkProps{Href: uiutils.URL(vSwitchHref, false), Attrs: uiutils.Attrs("data-slot", "switch")}}) {
{ uiutils.Text(vSwitchLink) }
}
}
}
}
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 auth-card{#- 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-card.json
A sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button, optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout (card, plain), social (none, show).
Props (p): id, title, text, submit, switchText, switchLink, switchHref, labels, mode, layout, social, level, 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_switchText = (p.switchText ?? null) -%}
{%- set v_switchLink = (p.switchLink ?? null) -%}
{%- set v_switchHref = (p.switchHref ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_mode = (p.mode ?? 'signin') -%}
{%- set v_layout = (p.layout ?? 'card') -%}
{%- set v_social = (p.social ?? 'none') -%}
{%- set v_level = (p.level ?? 2) -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_16 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ og_text(v_title) }}
{%- endset -%}
{{ include('compose/Title.html.twig', {'as': og_i(v_level), 'size': '2xl', 'weight': 'bold', 'attrs': og_attrs(['id', og_tpl('{0}-title', [v_id])]), 'children': c_1}, with_context = false) }}
{%- set c_2 -%}
{{ og_text(v_text) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_2}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '2', 'children': c_3}, with_context = false) }}
{%- if og_t(og_and([og_eq(v_social, 'first'), not (og_eq(v_social, 'none')), not (og_eq(v_mode, 'reset')), not (og_eq(v_mode, 'magic'))])) %}
{%- set c_8 -%}
{%- set c_5 -%}
{{ include('compose/Separator.html.twig', {'class': 'flex-1'}, with_context = false) }}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['divider'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_4}, with_context = false) }}
{{ include('compose/Separator.html.twig', {'class': 'flex-1'}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'children': c_5}, with_context = false) }}
{%- set c_6 -%}
{{ include('icons/LucideIcon.html.twig', {'name': 'key-round', 'size': 16}, with_context = false) }}
{{ og_text(og_get(v_labels, ['passkey'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'default', 'type': 'button', 'class': 'w-full', 'children': c_6}, with_context = false) }}
{%- set c_7 -%}
{{ include('icons/LucideIcon.html.twig', {'name': 'mail', 'size': 16}, with_context = false) }}
{{ og_text(og_get(v_labels, ['magic'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'default', 'type': 'button', 'class': 'w-full', 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'attrs': og_attrs(['data-slot', 'social']), 'children': c_8}, with_context = false) }}
{%- endif %}
{{ include('blocks/auth-form.html.twig', {'p': {'id': v_id, 'mode': v_mode, 'labels': v_labels, 'submit': v_submit}}, with_context = false) }}
{%- if og_t(og_and([not (og_eq(v_social, 'first')), not (og_eq(v_social, 'none')), not (og_eq(v_mode, 'reset')), not (og_eq(v_mode, 'magic'))])) %}
{%- set c_13 -%}
{%- set c_10 -%}
{{ include('compose/Separator.html.twig', {'class': 'flex-1'}, with_context = false) }}
{%- set c_9 -%}
{{ og_text(og_get(v_labels, ['divider'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_9}, with_context = false) }}
{{ include('compose/Separator.html.twig', {'class': 'flex-1'}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'children': c_10}, with_context = false) }}
{%- set c_11 -%}
{{ include('icons/LucideIcon.html.twig', {'name': 'key-round', 'size': 16}, with_context = false) }}
{{ og_text(og_get(v_labels, ['passkey'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'default', 'type': 'button', 'class': 'w-full', 'children': c_11}, with_context = false) }}
{%- set c_12 -%}
{{ include('icons/LucideIcon.html.twig', {'name': 'mail', 'size': 16}, with_context = false) }}
{{ og_text(og_get(v_labels, ['magic'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'outline', 'size': 'default', 'type': 'button', 'class': 'w-full', 'children': c_12}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'attrs': og_attrs(['data-slot', 'social']), 'children': c_13}, with_context = false) }}
{%- endif %}
{%- set c_15 -%}
{{ og_text(v_switchText) }}
{{ og_text(' ') }}
{%- set c_14 -%}
{{ og_text(v_switchLink) }}
{%- endset -%}
{{ include('compose/Link.html.twig', {'href': og_url(og_s(v_switchHref)), 'variant': 'default', 'attrs': og_attrs(['data-slot', 'switch']), 'children': c_14}, with_context = false) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-center text-muted-foreground', 'children': c_15}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'section', 'class': og_s(og_cnv(['flex w-full flex-col gap-6', (og_t(og_eq(v_layout, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')])), 'attrs': og_attrs(['aria-labelledby', (og_t(v_landmarkLabel) ? null : og_tpl('{0}-title', [v_id])), 'data-mode', v_mode, 'aria-label', v_landmarkLabel, 'data-slot', 'auth-card']), 'children': c_16}, 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 auth-card{* 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-card.json
A sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button, optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout (card, plain), social (none, show).
Props (p): id, title, text, submit, switchText, switchLink, switchHref, labels, mode, layout, social, level, 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_switchText = ($p['switchText'] ?? null)}
{var $v_switchLink = ($p['switchLink'] ?? null)}
{var $v_switchHref = ($p['switchHref'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_mode = ($p['mode'] ?? 'signin')}
{var $v_layout = ($p['layout'] ?? 'card')}
{var $v_social = ($p['social'] ?? 'none')}
{var $v_level = ($p['level'] ?? 2)}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_16}
{capture $c_3}
{capture $c_1}
{=og_text($v_title)}
{/capture}
{=og_include('compose/Title.latte', ['as' => og_i($v_level), 'size' => '2xl', 'weight' => 'bold', 'attrs' => og_attrs(['id', og_tpl('{0}-title', [$v_id])]), 'children' => (string) $c_1])|noescape}
{capture $c_2}
{=og_text($v_text)}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_2])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '2', 'children' => (string) $c_3])|noescape}
{if og_t(og_and([og_eq($v_social, 'first'), !(og_eq($v_social, 'none')), !(og_eq($v_mode, 'reset')), !(og_eq($v_mode, 'magic'))]))}
{capture $c_8}
{capture $c_5}
{=og_include('compose/Separator.latte', ['class' => 'flex-1'])|noescape}
{capture $c_4}
{=og_text(og_get($v_labels, ['divider']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_4])|noescape}
{=og_include('compose/Separator.latte', ['class' => 'flex-1'])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'children' => (string) $c_5])|noescape}
{capture $c_6}
{=og_include('icons/LucideIcon.latte', ['name' => 'key-round', 'size' => 16])|noescape}
{=og_text(og_get($v_labels, ['passkey']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'default', 'type' => 'button', 'class' => 'w-full', 'children' => (string) $c_6])|noescape}
{capture $c_7}
{=og_include('icons/LucideIcon.latte', ['name' => 'mail', 'size' => 16])|noescape}
{=og_text(og_get($v_labels, ['magic']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'default', 'type' => 'button', 'class' => 'w-full', 'children' => (string) $c_7])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'attrs' => og_attrs(['data-slot', 'social']), 'children' => (string) $c_8])|noescape}
{/if}
{=og_include('blocks/auth-form.latte', ['p' => ['id' => $v_id, 'mode' => $v_mode, 'labels' => $v_labels, 'submit' => $v_submit]])|noescape}
{if og_t(og_and([!(og_eq($v_social, 'first')), !(og_eq($v_social, 'none')), !(og_eq($v_mode, 'reset')), !(og_eq($v_mode, 'magic'))]))}
{capture $c_13}
{capture $c_10}
{=og_include('compose/Separator.latte', ['class' => 'flex-1'])|noescape}
{capture $c_9}
{=og_text(og_get($v_labels, ['divider']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_9])|noescape}
{=og_include('compose/Separator.latte', ['class' => 'flex-1'])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'children' => (string) $c_10])|noescape}
{capture $c_11}
{=og_include('icons/LucideIcon.latte', ['name' => 'key-round', 'size' => 16])|noescape}
{=og_text(og_get($v_labels, ['passkey']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'default', 'type' => 'button', 'class' => 'w-full', 'children' => (string) $c_11])|noescape}
{capture $c_12}
{=og_include('icons/LucideIcon.latte', ['name' => 'mail', 'size' => 16])|noescape}
{=og_text(og_get($v_labels, ['magic']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'outline', 'size' => 'default', 'type' => 'button', 'class' => 'w-full', 'children' => (string) $c_12])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'attrs' => og_attrs(['data-slot', 'social']), 'children' => (string) $c_13])|noescape}
{/if}
{capture $c_15}
{=og_text($v_switchText)}
{=og_text(' ')}
{capture $c_14}
{=og_text($v_switchLink)}
{/capture}
{=og_include('compose/Link.latte', ['href' => og_url(og_s($v_switchHref)), 'variant' => 'default', 'attrs' => og_attrs(['data-slot', 'switch']), 'children' => (string) $c_14])|noescape}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-center text-muted-foreground', 'children' => (string) $c_15])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'section', 'class' => og_s(og_cnv(['flex w-full flex-col gap-6', (og_t(og_eq($v_layout, 'card')) ? 'rounded bg-card p-6 inset-ring inset-ring-border' : '')])), 'attrs' => og_attrs(['aria-labelledby', (og_t($v_landmarkLabel) ? null : og_tpl('{0}-title', [$v_id])), 'data-mode', $v_mode, 'aria-label', $v_landmarkLabel, 'data-slot', 'auth-card']), 'children' => (string) $c_16])|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 auth-card{#- 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-card.json
A sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button, optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout (card, plain), social (none, show).
Props (p): id, title, text, submit, switchText, switchLink, switchHref, labels, mode, layout, social, level, 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_switchText = og_def(p['switchText'], none) -%}
{%- set v_switchLink = og_def(p['switchLink'], none) -%}
{%- set v_switchHref = og_def(p['switchHref'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_mode = og_def(p['mode'], 'signin') -%}
{%- set v_layout = og_def(p['layout'], 'card') -%}
{%- set v_social = og_def(p['social'], 'none') -%}
{%- set v_level = og_def(p['level'], 2) -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_16 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ og_text(v_title) }}
{%- endset -%}
{{ og_include('compose/title.html.j2', {'p': {'As': og_i(v_level), 'Size': '2xl', 'Weight': 'bold', 'Attrs': og_attrs(['id', og_tpl('{0}-title', [v_id])])}, 'children': c_1}) }}
{%- set c_2 -%}
{{ og_text(v_text) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '2'}, 'children': c_3}) }}
{%- if og_t(og_and([og_eq(v_social, 'first'), not (og_eq(v_social, 'none')), not (og_eq(v_mode, 'reset')), not (og_eq(v_mode, 'magic'))])) %}
{%- set c_8 -%}
{%- set c_5 -%}
{{ og_include('compose/separator.html.j2', {'p': {'Class': 'flex-1'}}) }}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['divider'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_4}) }}
{{ og_include('compose/separator.html.j2', {'p': {'Class': 'flex-1'}}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center'}, 'children': c_5}) }}
{%- set c_6 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'key-round', 'Size': 16}}) }}
{{ og_text(og_get(v_labels, ['passkey'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Type': 'button', 'Class': 'w-full'}, 'children': c_6}) }}
{%- set c_7 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'mail', 'Size': 16}}) }}
{{ og_text(og_get(v_labels, ['magic'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Type': 'button', 'Class': 'w-full'}, 'children': c_7}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Attrs': og_attrs(['data-slot', 'social'])}, 'children': c_8}) }}
{%- endif %}
{{ og_include('blocks/auth-form.html.j2', {'p': {'id': v_id, 'mode': v_mode, 'labels': v_labels, 'submit': v_submit}}) }}
{%- if og_t(og_and([not (og_eq(v_social, 'first')), not (og_eq(v_social, 'none')), not (og_eq(v_mode, 'reset')), not (og_eq(v_mode, 'magic'))])) %}
{%- set c_13 -%}
{%- set c_10 -%}
{{ og_include('compose/separator.html.j2', {'p': {'Class': 'flex-1'}}) }}
{%- set c_9 -%}
{{ og_text(og_get(v_labels, ['divider'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_9}) }}
{{ og_include('compose/separator.html.j2', {'p': {'Class': 'flex-1'}}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center'}, 'children': c_10}) }}
{%- set c_11 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'key-round', 'Size': 16}}) }}
{{ og_text(og_get(v_labels, ['passkey'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Type': 'button', 'Class': 'w-full'}, 'children': c_11}) }}
{%- set c_12 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'mail', 'Size': 16}}) }}
{{ og_text(og_get(v_labels, ['magic'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'outline', 'Size': 'default', 'Type': 'button', 'Class': 'w-full'}, 'children': c_12}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Attrs': og_attrs(['data-slot', 'social'])}, 'children': c_13}) }}
{%- endif %}
{%- set c_15 -%}
{{ og_text(v_switchText) }}
{{ og_text(' ') }}
{%- set c_14 -%}
{{ og_text(v_switchLink) }}
{%- endset -%}
{{ og_include('compose/link.html.j2', {'p': {'Href': og_url(og_s(v_switchHref)), 'Variant': 'default', 'Attrs': og_attrs(['data-slot', 'switch'])}, 'children': c_14}) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-center text-muted-foreground'}, 'children': c_15}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'section', 'Class': og_s(og_cnv(['flex w-full flex-col gap-6', ('rounded bg-card p-6 inset-ring inset-ring-border' if og_t(og_eq(v_layout, 'card')) else '')])), 'Attrs': og_attrs(['aria-labelledby', (none if og_t(v_landmarkLabel) else og_tpl('{0}-title', [v_id])), 'data-mode', v_mode, 'aria-label', v_landmarkLabel, 'data-slot', 'auth-card'])}, 'children': c_16}) }}
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 sign-in, sign-up or password reset card: heading, one sentence, the fields of the mode, a submit button, optional alternative sign-in buttons and a link to the other mode. Axes: mode (signin, signup, reset), layout (card, plain), social (none, show).
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | |
| title (required) | string | - | |
| text (required) | string | - | |
| submit (required) | string | - | |
| switchText (required) | string | - | the question before the link to the other mode |
| switchLink (required) | string | - | |
| switchHref | string | - | |
| labels (required) | AuthLabels | - | |
| mode | "signin" | "signup" | "reset" | "magic" | "signin" | |
| layout | "card" | "plain" | "card" | |
| social | "none" | "show" | "first" | "none" | first: the other sign-in buttons come before the fields |
| level | 1 | 2 | 2 | |
| 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 |