Footer Signup Card
Footer Signup Card component
Install
npx ui8kit add footer-signup-cardPulls in: button, compose, footer-split, form, group, input, kit-box, kit-button, kit-form, kit-input, kit-label, kit-text, label, lucide-icon, stack, text, utils
Preview
Newsletter
No spam. Leave at any time.
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 footer-signup-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. -->
<!-- The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note. -->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterSignupCardProps = {
id: string;
labels: FooterSplitLabels;
};
</script>
<script lang="ts">
import Button from "../compose/Button.svelte";
import Form from "../compose/Form.svelte";
import Group from "../compose/Group.svelte";
import Input from "../compose/Input.svelte";
import Label from "../compose/Label.svelte";
import LucideIcon from "../icons/LucideIcon.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import { cn, tpl } from "../utils";
let { id, labels }: FooterSignupCardProps = $props();
</script>
<Stack gap="4" align="stretch" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="signup">
<Group gap="2" align="center">
<LucideIcon name="mail" size={16} />
<Text size="sm" weight="semibold">
{labels.signup}
</Text>
</Group>
<Form method="dialog" class={cn("w-full max-w-md", (false ? "mx-auto" : ""))} data-slot="email-form">
<Label for={tpl("{0}-email", id)} class="sr-only">
{labels.email}
</Label>
<Group gap="2" align="start" class="w-full flex-wrap">
<Input type="email" name="email" class="min-w-0 flex-1" id={tpl("{0}-email", id)} data-slot="field" />
<Button variant="default" size="default" type="submit">
{labels.subscribe}
</Button>
</Group>
</Form>
<Text size="xs" class="text-muted-foreground">
{labels.note}
</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 footer-signup-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.
/** The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note. */
import { type ReactNode } from "react";
import { Button, Form, Group, Input, Label, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { cn, tpl } from "../utils";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterSignupCardProps = {
id: string;
labels: FooterSplitLabels;
};
export function FooterSignupCard({ id, labels }: FooterSignupCardProps) {
return (
<Stack gap="4" align="stretch" className="rounded bg-card inset-ring inset-ring-border p-6" data-slot="signup">
<Group gap="2" align="center">
<LucideIcon name="mail" size={16} />
<Text size="sm" weight="semibold">
{labels.signup}
</Text>
</Group>
<Form method="dialog" className={cn("w-full max-w-md", (false ? "mx-auto" : ""))} data-slot="email-form">
<Label htmlFor={tpl("{0}-email", id)} className="sr-only">
{labels.email}
</Label>
<Group gap="2" align="start" className="w-full flex-wrap">
<Input type="email" name="email" className="min-w-0 flex-1" id={tpl("{0}-email", id)} data-slot="field" />
<Button variant="default" size="default" type="submit">
{labels.subscribe}
</Button>
</Group>
</Form>
<Text size="xs" className="text-muted-foreground">
{labels.note}
</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 footer-signup-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. -->
<!-- The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note. -->
<script lang="ts">
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterSignupCardProps = {
id: string;
labels: FooterSplitLabels;
};
</script>
<script setup lang="ts">
import Button from "../compose/Button.vue";
import Form from "../compose/Form.vue";
import Group from "../compose/Group.vue";
import Input from "../compose/Input.vue";
import Label from "../compose/Label.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import { cn, tpl } from "../utils";
const { id, labels } = defineProps<FooterSignupCardProps>();
</script>
<template>
<Stack gap="4" align="stretch" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="signup">
<Group gap="2" align="center">
<LucideIcon name="mail" :size="16" />
<Text size="sm" weight="semibold">
{{ labels.signup }}
</Text>
</Group>
<Form method="dialog" :class="cn('w-full max-w-md', (false ? 'mx-auto' : ''))" data-slot="email-form">
<Label :for="tpl('{0}-email', id)" class="sr-only">
{{ labels.email }}
</Label>
<Group gap="2" align="start" class="w-full flex-wrap">
<Input type="email" name="email" class="min-w-0 flex-1" :id="tpl('{0}-email', id)" data-slot="field" />
<Button variant="default" size="default" type="submit">
{{ labels.subscribe }}
</Button>
</Group>
</Form>
<Text size="xs" class="text-muted-foreground">
{{ labels.note }}
</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 footer-signup-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.
/** The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note. */
import { For, type JSX } from "solid-js";
import { Button, Form, Group, Input, Label, Stack, Text } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { cn, tpl } from "../utils";
import type { FooterExtras, FooterSplitLabels } from "../blocks/footer-split.types";
export type FooterSignupCardProps = {
id: string;
labels: FooterSplitLabels;
};
export function FooterSignupCard({ id, labels }: FooterSignupCardProps) {
return (
<Stack gap="4" align="stretch" class="rounded bg-card inset-ring inset-ring-border p-6" data-slot="signup">
<Group gap="2" align="center">
<LucideIcon name="mail" size={16} />
<Text size="sm" weight="semibold">
{labels.signup}
</Text>
</Group>
<Form method="dialog" class={cn("w-full max-w-md", (false ? "mx-auto" : ""))} data-slot="email-form">
<Label for={tpl("{0}-email", id)} class="sr-only">
{labels.email}
</Label>
<Group gap="2" align="start" class="w-full flex-wrap">
<Input type="email" name="email" class="min-w-0 flex-1" id={tpl("{0}-email", id)} data-slot="field" />
<Button variant="default" size="default" type="submit">
{labels.subscribe}
</Button>
</Group>
</Form>
<Text size="xs" class="text-muted-foreground">
{labels.note}
</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 footer-signup-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/footer-signup-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/ui/form"
"github.com/ui8kit/codegen/generated/templ/icons"
"github.com/ui8kit/codegen/generated/templ/ui/input"
"github.com/ui8kit/codegen/generated/templ/ui/label"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// FooterSignupCardProps are the props of FooterSignupCard; the values are the JSON shapes of the TypeScript props.
type FooterSignupCardProps struct {
Id any `json:"id"`
Labels any `json:"labels"`
}
// The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note.
templ FooterSignupCard(p FooterSignupCardProps) {
{{ vId := p.Id }}
{{ vLabels := p.Labels }}
@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: "rounded bg-card inset-ring inset-ring-border p-6", Attrs: uiutils.Attrs("data-slot", "signup")}}) {
@compose.Group(compose.GroupProps{Gap: "2", Align: "center", BoxProps: box.BoxProps{}}) {
@icons.LucideIcon(icons.LucideIconProps{Name: "mail", Size: 16})
@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vLabels, "signup")) }
}
}
@compose.Form(compose.FormProps{FormProps: form.FormProps{Method: "dialog", Class: uiutils.S(uiutils.Cnv("w-full max-w-md", uiutils.Cond(uiutils.T(false), "mx-auto", ""))), Attrs: uiutils.Attrs("data-slot", "email-form")}}) {
@compose.Label(compose.LabelProps{LabelProps: label.LabelProps{For: uiutils.S(uiutils.Tpl("{0}-email", vId)), Class: "sr-only"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "email")) }
}
@compose.Group(compose.GroupProps{Gap: "2", Align: "start", BoxProps: box.BoxProps{Class: "w-full flex-wrap"}}) {
@compose.Input(compose.InputProps{InputProps: input.InputProps{Type: "email", Name: "email", Class: "min-w-0 flex-1", Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-email", vId), "data-slot", "field")}})
@compose.Button(compose.ButtonProps{Variant: "default", Size: "default", ButtonProps: button.ButtonProps{Type: "submit"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "subscribe")) }
}
}
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "note")) }
}
}
}
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 footer-signup-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/footer-signup-card.json
The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note.
Props (p): id, labels. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set c_8 -%}
{%- set c_2 -%}
{{ include('icons/LucideIcon.html.twig', {'name': 'mail', 'size': 16}, with_context = false) }}
{%- set c_1 -%}
{{ og_text(og_get(v_labels, ['signup'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_1}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '2', 'align': 'center', 'children': c_2}, with_context = false) }}
{%- set c_6 -%}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['email'])) }}
{%- endset -%}
{{ include('compose/Label.html.twig', {'htmlFor': og_s(og_tpl('{0}-email', [v_id])), 'class': 'sr-only', 'children': c_3}, with_context = false) }}
{%- set c_5 -%}
{{ include('compose/Input.html.twig', {'type': 'email', 'name': 'email', 'class': 'min-w-0 flex-1', 'attrs': og_attrs(['id', og_tpl('{0}-email', [v_id]), 'data-slot', 'field'])}, with_context = false) }}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['subscribe'])) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'default', 'type': 'submit', 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '2', 'align': 'start', 'class': 'w-full flex-wrap', 'children': c_5}, with_context = false) }}
{%- endset -%}
{{ include('compose/Form.html.twig', {'method': 'dialog', 'class': og_s(og_cnv(['w-full max-w-md', (og_t(false) ? 'mx-auto' : '')])), 'attrs': og_attrs(['data-slot', 'email-form']), 'children': c_6}, with_context = false) }}
{%- set c_7 -%}
{{ og_text(og_get(v_labels, ['note'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_7}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs': og_attrs(['data-slot', 'signup']), 'children': c_8}, 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 footer-signup-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/footer-signup-card.json
The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note.
Props (p): id, labels. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{capture $c_8}
{capture $c_2}
{=og_include('icons/LucideIcon.latte', ['name' => 'mail', 'size' => 16])|noescape}
{capture $c_1}
{=og_text(og_get($v_labels, ['signup']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_1])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'center', 'children' => (string) $c_2])|noescape}
{capture $c_6}
{capture $c_3}
{=og_text(og_get($v_labels, ['email']))}
{/capture}
{=og_include('compose/Label.latte', ['htmlFor' => og_s(og_tpl('{0}-email', [$v_id])), 'class' => 'sr-only', 'children' => (string) $c_3])|noescape}
{capture $c_5}
{=og_include('compose/Input.latte', ['type' => 'email', 'name' => 'email', 'class' => 'min-w-0 flex-1', 'attrs' => og_attrs(['id', og_tpl('{0}-email', [$v_id]), 'data-slot', 'field'])])|noescape}
{capture $c_4}
{=og_text(og_get($v_labels, ['subscribe']))}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'default', 'size' => 'default', 'type' => 'submit', 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '2', 'align' => 'start', 'class' => 'w-full flex-wrap', 'children' => (string) $c_5])|noescape}
{/capture}
{=og_include('compose/Form.latte', ['method' => 'dialog', 'class' => og_s(og_cnv(['w-full max-w-md', (og_t(false) ? 'mx-auto' : '')])), 'attrs' => og_attrs(['data-slot', 'email-form']), 'children' => (string) $c_6])|noescape}
{capture $c_7}
{=og_text(og_get($v_labels, ['note']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_7])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => 'rounded bg-card inset-ring inset-ring-border p-6', 'attrs' => og_attrs(['data-slot', 'signup']), 'children' => (string) $c_8])|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 footer-signup-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/footer-signup-card.json
The newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note.
Props (p): id, labels. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set c_8 -%}
{%- set c_2 -%}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'mail', 'Size': 16}}) }}
{%- set c_1 -%}
{{ og_text(og_get(v_labels, ['signup'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_1}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'center'}, 'children': c_2}) }}
{%- set c_6 -%}
{%- set c_3 -%}
{{ og_text(og_get(v_labels, ['email'])) }}
{%- endset -%}
{{ og_include('compose/label.html.j2', {'p': {'For': og_s(og_tpl('{0}-email', [v_id])), 'Class': 'sr-only'}, 'children': c_3}) }}
{%- set c_5 -%}
{{ og_include('compose/input.html.j2', {'p': {'Type': 'email', 'Name': 'email', 'Class': 'min-w-0 flex-1', 'Attrs': og_attrs(['id', og_tpl('{0}-email', [v_id]), 'data-slot', 'field'])}}) }}
{%- set c_4 -%}
{{ og_text(og_get(v_labels, ['subscribe'])) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'default', 'Type': 'submit'}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '2', 'Align': 'start', 'Class': 'w-full flex-wrap'}, 'children': c_5}) }}
{%- endset -%}
{{ og_include('compose/form.html.j2', {'p': {'Method': 'dialog', 'Class': og_s(og_cnv(['w-full max-w-md', ('mx-auto' if og_t(false) else '')])), 'Attrs': og_attrs(['data-slot', 'email-form'])}, 'children': c_6}) }}
{%- set c_7 -%}
{{ og_text(og_get(v_labels, ['note'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_7}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': 'rounded bg-card inset-ring inset-ring-border p-6', 'Attrs': og_attrs(['data-slot', 'signup'])}, 'children': c_8}) }}
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 newsletter sign-up of FooterSplit in a card: a title with a glyph, the email field and button, and a note.
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | ties the email label to its field |
| labels (required) | FooterSplitLabels | - |