Checkout Submit
Checkout Submit component
Install
npx ui8kit add checkout-submitPulls in: button, checkbox, compose, group, kit-box, kit-button, kit-checkbox, kit-label, kit-text, label, stack, text, utils
Preview
By placing the order you confirm the address and the window.
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 checkout-submit<!-- 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 end of the checkout form: the consent checkbox, the submit button and the legal line. -->
<script lang="ts" module>
import type { Snippet } from "svelte";
export type CheckoutSubmitProps = {
id: string;
consent: string;
submit: string;
legal: string;
};
</script>
<script lang="ts">
import Button from "../compose/Button.svelte";
import Checkbox from "../compose/Checkbox.svelte";
import Group from "../compose/Group.svelte";
import Label from "../compose/Label.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import { cn, tpl } from "../utils";
let { id, consent, submit, legal }: CheckoutSubmitProps = $props();
</script>
<Stack gap="4" align="start" data-slot="checkout-submit">
<Group gap="2" align="center" class={cn("w-fit", "")}>
<Checkbox name="consent" id={tpl("{0}-consent", id)} />
<Label for={tpl("{0}-consent", id)} class="text-sm">
{consent}
</Label>
</Group>
<Button variant="default" size="lg" type="submit">
{submit}
</Button>
<Text size="xs" class="text-muted-foreground">
{legal}
</Text>
</Stack>
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 checkout-submit// 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 end of the checkout form: the consent checkbox, the submit button and the legal line. */
import { type ReactNode } from "react";
import { Button, Checkbox, Group, Label, Stack, Text } from "../compose";
import { cn, tpl } from "../utils";
export type CheckoutSubmitProps = {
id: string;
consent: string;
submit: string;
legal: string;
};
export function CheckoutSubmit({ id, consent, submit, legal }: CheckoutSubmitProps) {
return (
<Stack gap="4" align="start" data-slot="checkout-submit">
<Group gap="2" align="center" className={cn("w-fit", "")}>
<Checkbox name="consent" id={tpl("{0}-consent", id)} />
<Label htmlFor={tpl("{0}-consent", id)} className="text-sm">
{consent}
</Label>
</Group>
<Button variant="default" size="lg" type="submit">
{submit}
</Button>
<Text size="xs" className="text-muted-foreground">
{legal}
</Text>
</Stack>
);
}
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 checkout-submit<!-- 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 end of the checkout form: the consent checkbox, the submit button and the legal line. -->
<script lang="ts">
export type CheckoutSubmitProps = {
id: string;
consent: string;
submit: string;
legal: string;
};
</script>
<script setup lang="ts">
import Button from "../compose/Button.vue";
import Checkbox from "../compose/Checkbox.vue";
import Group from "../compose/Group.vue";
import Label from "../compose/Label.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import { cn, tpl } from "../utils";
const { id, consent, submit, legal } = defineProps<CheckoutSubmitProps>();
</script>
<template>
<Stack gap="4" align="start" data-slot="checkout-submit">
<Group gap="2" align="center" :class="cn('w-fit', '')">
<Checkbox name="consent" :id="tpl('{0}-consent', id)" />
<Label :for="tpl('{0}-consent', id)" class="text-sm">
{{ consent }}
</Label>
</Group>
<Button variant="default" size="lg" type="submit">
{{ submit }}
</Button>
<Text size="xs" class="text-muted-foreground">
{{ legal }}
</Text>
</Stack>
</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 checkout-submit// 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 end of the checkout form: the consent checkbox, the submit button and the legal line. */
import { type JSX } from "solid-js";
import { Button, Checkbox, Group, Label, Stack, Text } from "../compose";
import { cn, tpl } from "../utils";
export type CheckoutSubmitProps = {
id: string;
consent: string;
submit: string;
legal: string;
};
export function CheckoutSubmit({ id, consent, submit, legal }: CheckoutSubmitProps) {
return (
<Stack gap="4" align="start" data-slot="checkout-submit">
<Group gap="2" align="center" class={cn("w-fit", "")}>
<Checkbox name="consent" id={tpl("{0}-consent", id)} />
<Label for={tpl("{0}-consent", id)} class="text-sm">
{consent}
</Label>
</Group>
<Button variant="default" size="lg" type="submit">
{submit}
</Button>
<Text size="xs" class="text-muted-foreground">
{legal}
</Text>
</Stack>
);
}
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 checkout-submit// 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/checkout-submit.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/ui/checkbox"
"github.com/ui8kit/codegen/generated/templ/compose"
"github.com/ui8kit/codegen/generated/templ/ui/label"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// CheckoutSubmitProps are the props of CheckoutSubmit; the values are the JSON shapes of the TypeScript props.
type CheckoutSubmitProps struct {
Id any `json:"id"`
Consent any `json:"consent"`
Submit any `json:"submit"`
Legal any `json:"legal"`
}
// The end of the checkout form: the consent checkbox, the submit button and the legal line.
templ CheckoutSubmit(p CheckoutSubmitProps) {
{{ vId := p.Id }}
{{ vConsent := p.Consent }}
{{ vSubmit := p.Submit }}
{{ vLegal := p.Legal }}
@compose.Stack(compose.StackProps{Gap: "4", Align: "start", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "checkout-submit")}}) {
@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("w-fit", ""))}}) {
@compose.Checkbox(compose.CheckboxProps{CheckboxProps: checkbox.CheckboxProps{Name: "consent", Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-consent", vId))}})
@compose.Label(compose.LabelProps{LabelProps: label.LabelProps{For: uiutils.S(uiutils.Tpl("{0}-consent", vId)), Class: "text-sm"}}) {
{ uiutils.Text(vConsent) }
}
}
@compose.Button(compose.ButtonProps{Variant: "default", Size: "lg", ButtonProps: button.ButtonProps{Type: "submit"}}) {
{ uiutils.Text(vSubmit) }
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(vLegal) }
}
}
}
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 checkout-submit{#- 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/checkout-submit.json
The end of the checkout form: the consent checkbox, the submit button and the legal line.
Props (p): id, consent, submit, legal. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_consent = (p.consent ?? null) -%}
{%- set v_submit = (p.submit ?? null) -%}
{%- set v_legal = (p.legal ?? null) -%}
{%- set c_5 -%}
{%- set c_2 -%}
{{ include('compose/Checkbox.html.twig', {'name': 'consent', 'attrs': og_attrs(['id', og_tpl('{0}-consent', [v_id])])}, with_context = false) }}
{%- set c_1 -%}
{{ og_text(v_consent) }}
{%- endset -%}
{{ include('compose/Label.html.twig', {'htmlFor': og_s(og_tpl('{0}-consent', [v_id])), 'class': 'text-sm', 'children': c_1}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'class': og_s(og_cnv(['w-fit', ''])), 'children': c_2}, with_context = false) }}
{%- set c_3 -%}
{{ og_text(v_submit) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'lg', 'type': 'submit', 'children': c_3}, with_context = false) }}
{%- set c_4 -%}
{{ og_text(v_legal) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'start', 'attrs': og_attrs(['data-slot', 'checkout-submit']), 'children': c_5}, 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 checkout-submit{* 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/checkout-submit.json
The end of the checkout form: the consent checkbox, the submit button and the legal line.
Props (p): id, consent, submit, legal. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_consent = ($p['consent'] ?? null)}
{var $v_submit = ($p['submit'] ?? null)}
{var $v_legal = ($p['legal'] ?? null)}
{capture $c_5}
{capture $c_2}
{=og_include('compose/Checkbox.latte', ['name' => 'consent', 'attrs' => og_attrs(['id', og_tpl('{0}-consent', [$v_id])])])|noescape}
{capture $c_1}
{=og_text($v_consent)}
{/capture}
{=og_include('compose/Label.latte', ['htmlFor' => og_s(og_tpl('{0}-consent', [$v_id])), 'class' => 'text-sm', 'children' => (string) $c_1])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'class' => og_s(og_cnv(['w-fit', ''])), 'children' => (string) $c_2])|noescape}
{capture $c_3}
{=og_text($v_submit)}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'default', 'size' => 'lg', 'type' => 'submit', 'children' => (string) $c_3])|noescape}
{capture $c_4}
{=og_text($v_legal)}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'start', 'attrs' => og_attrs(['data-slot', 'checkout-submit']), 'children' => (string) $c_5])|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 checkout-submit{#- 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/checkout-submit.json
The end of the checkout form: the consent checkbox, the submit button and the legal line.
Props (p): id, consent, submit, legal. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_consent = og_def(p['consent'], none) -%}
{%- set v_submit = og_def(p['submit'], none) -%}
{%- set v_legal = og_def(p['legal'], none) -%}
{%- set c_5 -%}
{%- set c_2 -%}
{{ og_include('compose/checkbox.html.j2', {'p': {'Name': 'consent', 'Attrs': og_attrs(['id', og_tpl('{0}-consent', [v_id])])}}) }}
{%- set c_1 -%}
{{ og_text(v_consent) }}
{%- endset -%}
{{ og_include('compose/label.html.j2', {'p': {'For': og_s(og_tpl('{0}-consent', [v_id])), 'Class': 'text-sm'}, 'children': c_1}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center', 'Class': og_s(og_cnv(['w-fit', '']))}, 'children': c_2}) }}
{%- set c_3 -%}
{{ og_text(v_submit) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'lg', 'Type': 'submit'}, 'children': c_3}) }}
{%- set c_4 -%}
{{ og_text(v_legal) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'start', 'Attrs': og_attrs(['data-slot', 'checkout-submit'])}, 'children': c_5}) }}
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 end of the checkout form: the consent checkbox, the submit button and the legal line.
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | id of the form block (the checkbox id is <id>-consent) |
| consent (required) | string | - | |
| submit (required) | string | - | |
| legal (required) | string | - |