Cta Band
A closing call to action.
Install
npx ui8kit add cta-bandPulls in: block, card, card-content, compose, container, cta-actions, cta-banner, kit-box, kit-text, media-frame, quote-proof, section-frame, stack, text, title, utils
Preview
AI-powered website builder with ready-to-use templates
Generate complete HTML, CSS, and JavaScript projects in minutes — just pick a template and share your idea.
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 cta-band<!-- 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 closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split
picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof
(none, quote), density.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { CtaQuote } from "./cta-band.types";
import type { ActionSet } from "../components/cta-actions.types";
export type CtaBandProps = {
id: string;
title: string;
text: string;
actions: ActionSet;
quote?: CtaQuote;
layout?: "card" | "band" | "split" | "row" | "banner";
tone?: "default" | "muted";
proof?: "none" | "quote";
density?: "roomy" | "default" | "compact";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Block from "../compose/Block.svelte";
import Card from "../compose/Card.svelte";
import CardContent from "../compose/CardContent.svelte";
import Container from "../compose/Container.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import Title from "../compose/Title.svelte";
import CtaActions from "../components/cta-actions.svelte";
import CtaBanner from "../blocks/cta-banner.svelte";
import MediaFrame from "../components/media-frame.svelte";
import QuoteProof from "../components/quote-proof.svelte";
import SectionFrame from "../components/section-frame.svelte";
import { tpl } from "../utils";
let {
id,
title,
text,
actions,
quote,
layout = "card",
tone = "muted",
proof = "none",
density = "default",
image,
imageAlt,
landmarkLabel,
}: CtaBandProps = $props();
const center = $derived(((layout as string) === "band") || ((layout as string) === "banner"));
</script>
{#if ((layout as string) === "banner")}
<CtaBanner
id={id}
title={title}
text={text}
cta={actions.cta}
href={actions.href}
tone={tone}
landmarkLabel={landmarkLabel}
/>
{:else if ((layout as string) === "row")}
<Block
tag="section"
class="py-8"
aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
data-tone={tone}
data-density={density}
aria-label={landmarkLabel}
data-slot="section"
>
<Container class="mx-auto w-full max-w-6xl px-4" data-slot="container">
<Card variant="muted">
<CardContent class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<Stack gap="2" class="min-w-0">
<Title as={2} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
{title}
</Title>
<Text size="base" class="text-muted-foreground">
{text}
</Text>
</Stack>
{#if ((proof as string) === "quote")}
<QuoteProof quote={quote?.text} quoteBy={quote?.by} center={center} />
{/if}
<CtaActions id={id} actions={actions} center={center} />
</CardContent>
</Card>
</Container>
</Block>
{:else}
<SectionFrame
id={id}
title={title}
lead={text}
layout={(((layout as string) === "split") ? "split" : "stack")}
align={(center ? "center" : "start")}
boxed={((layout as string) === "card")}
media={{ show: ((layout as string) === "split") }}
tone={tone}
density={density}
landmarkLabel={landmarkLabel}
>
{#if ((proof as string) === "quote")}
<QuoteProof quote={quote?.text} quoteBy={quote?.by} center={center} />
{/if}
<CtaActions id={id} actions={actions} center={center} />
{#snippet aside()}
<MediaFrame alt={(imageAlt ? imageAlt : title)} src={image} ratio="4/3" />
{/snippet}
</SectionFrame>
{/if}
// 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 CtaQuote = {
/** a customer quote, shown when `proof` is quote */
text?: string;
/** who said it */
by?: 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 cta-band// 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 closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split
* picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof
* (none, quote), density.
*/
import { type ReactNode } from "react";
import { Block, Card, CardContent, Container, Stack, Text, Title } from "../compose";
import { CtaActions } from "../components/cta-actions";
import { CtaBanner } from "../blocks/cta-banner";
import { MediaFrame } from "../components/media-frame";
import { QuoteProof } from "../components/quote-proof";
import { SectionFrame } from "../components/section-frame";
import { tpl } from "../utils";
import type { CtaQuote } from "./cta-band.types";
import type { ActionSet } from "../components/cta-actions.types";
export type CtaBandProps = {
id: string;
title: string;
text: string;
actions: ActionSet;
quote?: CtaQuote;
layout?: "card" | "band" | "split" | "row" | "banner";
tone?: "default" | "muted";
proof?: "none" | "quote";
density?: "roomy" | "default" | "compact";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
export function CtaBand({
id,
title,
text,
actions,
quote,
layout = "card",
tone = "muted",
proof = "none",
density = "default",
image,
imageAlt,
landmarkLabel,
}: CtaBandProps) {
const center = ((layout as string) === "band") || ((layout as string) === "banner");
return (
<>
{((layout as string) === "banner") ? (
<CtaBanner
id={id}
title={title}
text={text}
cta={actions.cta}
href={actions.href}
tone={tone}
landmarkLabel={landmarkLabel}
/>
) : ((layout as string) === "row") ? (
<Block
tag="section"
className="py-8"
aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
data-tone={tone}
data-density={density}
aria-label={landmarkLabel}
data-slot="section"
>
<Container className="mx-auto w-full max-w-6xl px-4" data-slot="container">
<Card variant="muted">
<CardContent className="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<Stack gap="2" className="min-w-0">
<Title as={2} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
{title}
</Title>
<Text size="base" className="text-muted-foreground">
{text}
</Text>
</Stack>
{((proof as string) === "quote") ? (
<QuoteProof quote={quote?.text} quoteBy={quote?.by} center={center} />
) : null}
<CtaActions id={id} actions={actions} center={center} />
</CardContent>
</Card>
</Container>
</Block>
) : (
<SectionFrame
id={id}
title={title}
lead={text}
layout={(((layout as string) === "split") ? "split" : "stack")}
align={(center ? "center" : "start")}
boxed={((layout as string) === "card")}
media={{ show: ((layout as string) === "split") }}
tone={tone}
density={density}
landmarkLabel={landmarkLabel}
aside={(
<MediaFrame alt={(imageAlt ? imageAlt : title)} src={image} ratio="4/3" />
)}
>
{((proof as string) === "quote") ? (
<QuoteProof quote={quote?.text} quoteBy={quote?.by} center={center} />
) : null}
<CtaActions id={id} actions={actions} center={center} />
</SectionFrame>
)}
</>
);
}
// 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 CtaQuote = {
/** a customer quote, shown when `proof` is quote */
text?: string;
/** who said it */
by?: 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 cta-band// 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 CtaQuote = {
/** a customer quote, shown when `proof` is quote */
text?: string;
/** who said it */
by?: 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 closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split
picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof
(none, quote), density.
-->
<script lang="ts">
import type { CtaQuote } from "./cta-band.types";
import type { ActionSet } from "../components/cta-actions.types";
export type CtaBandProps = {
id: string;
title: string;
text: string;
actions: ActionSet;
quote?: CtaQuote;
layout?: "card" | "band" | "split" | "row" | "banner";
tone?: "default" | "muted";
proof?: "none" | "quote";
density?: "roomy" | "default" | "compact";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import { computed } from "vue";
import Block from "../compose/Block.vue";
import Card from "../compose/Card.vue";
import CardContent from "../compose/CardContent.vue";
import Container from "../compose/Container.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import Title from "../compose/Title.vue";
import CtaActions from "../components/cta-actions.vue";
import CtaBanner from "../blocks/cta-banner.vue";
import MediaFrame from "../components/media-frame.vue";
import QuoteProof from "../components/quote-proof.vue";
import SectionFrame from "../components/section-frame.vue";
import { tpl } from "../utils";
const {
id,
title,
text,
actions,
quote,
layout = "card",
tone = "muted",
proof = "none",
density = "default",
image,
imageAlt,
landmarkLabel,
} = defineProps<CtaBandProps>();
const center = computed(() => ((layout as string) === "band") || ((layout as string) === "banner"));
</script>
<template>
<CtaBanner v-if="((layout as string) === 'banner')"
:id="id"
:title="title"
:text="text"
:cta="actions.cta"
:href="actions.href"
:tone="tone"
:landmarkLabel="landmarkLabel"
/>
<Block v-else-if="((layout as string) === 'row')"
tag="section"
class="py-8"
:aria-labelledby="(landmarkLabel ? undefined : tpl('{0}-title', id))"
:data-tone="tone"
:data-density="density"
:aria-label="landmarkLabel"
data-slot="section"
>
<Container class="mx-auto w-full max-w-6xl px-4" data-slot="container">
<Card variant="muted">
<CardContent class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<Stack gap="2" class="min-w-0">
<Title :as="2" size="2xl" weight="bold" :id="tpl('{0}-title', id)">
{{ title }}
</Title>
<Text size="base" class="text-muted-foreground">
{{ text }}
</Text>
</Stack>
<QuoteProof
v-if="((proof as string) === 'quote')"
:quote="quote?.text"
:quoteBy="quote?.by"
:center="center"
/>
<CtaActions :id="id" :actions="actions" :center="center" />
</CardContent>
</Card>
</Container>
</Block>
<SectionFrame v-else
:id="id"
:title="title"
:lead="text"
:layout="(((layout as string) === 'split') ? 'split' : 'stack')"
:align="(center ? 'center' : 'start')"
:boxed="((layout as string) === 'card')"
:media="{ show: ((layout as string) === 'split') }"
:tone="tone"
:density="density"
:landmarkLabel="landmarkLabel"
>
<QuoteProof
v-if="((proof as string) === 'quote')"
:quote="quote?.text"
:quoteBy="quote?.by"
:center="center"
/>
<CtaActions :id="id" :actions="actions" :center="center" />
<template #aside>
<MediaFrame :alt="(imageAlt ? imageAlt : title)" :src="image" ratio="4/3" />
</template>
</SectionFrame>
</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 cta-band// 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 closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split
* picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof
* (none, quote), density.
*/
import { type JSX } from "solid-js";
import { Block, Card, CardContent, Container, Stack, Text, Title } from "../compose";
import { CtaActions } from "../components/cta-actions";
import { CtaBanner } from "../blocks/cta-banner";
import { MediaFrame } from "../components/media-frame";
import { QuoteProof } from "../components/quote-proof";
import { SectionFrame } from "../components/section-frame";
import { tpl } from "../utils";
import type { CtaQuote } from "./cta-band.types";
import type { ActionSet } from "../components/cta-actions.types";
export type CtaBandProps = {
id: string;
title: string;
text: string;
actions: ActionSet;
quote?: CtaQuote;
layout?: "card" | "band" | "split" | "row" | "banner";
tone?: "default" | "muted";
proof?: "none" | "quote";
density?: "roomy" | "default" | "compact";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
export function CtaBand({
id,
title,
text,
actions,
quote,
layout = "card",
tone = "muted",
proof = "none",
density = "default",
image,
imageAlt,
landmarkLabel,
}: CtaBandProps) {
const center = ((layout as string) === "band") || ((layout as string) === "banner");
return (
<>
{((layout as string) === "banner") ? (
<CtaBanner
id={id}
title={title}
text={text}
cta={actions.cta}
href={actions.href}
tone={tone}
landmarkLabel={landmarkLabel}
/>
) : ((layout as string) === "row") ? (
<Block
tag="section"
class="py-8"
aria-labelledby={(landmarkLabel ? undefined : tpl("{0}-title", id))}
data-tone={tone}
data-density={density}
aria-label={landmarkLabel}
data-slot="section"
>
<Container class="mx-auto w-full max-w-6xl px-4" data-slot="container">
<Card variant="muted">
<CardContent class="flex flex-col gap-4 md:flex-row md:items-center md:justify-between">
<Stack gap="2" class="min-w-0">
<Title as={2} size="2xl" weight="bold" id={tpl("{0}-title", id)}>
{title}
</Title>
<Text size="base" class="text-muted-foreground">
{text}
</Text>
</Stack>
{((proof as string) === "quote") ? (
<QuoteProof quote={quote?.text} quoteBy={quote?.by} center={center} />
) : null}
<CtaActions id={id} actions={actions} center={center} />
</CardContent>
</Card>
</Container>
</Block>
) : (
<SectionFrame
id={id}
title={title}
lead={text}
layout={(((layout as string) === "split") ? "split" : "stack")}
align={(center ? "center" : "start")}
boxed={((layout as string) === "card")}
media={{ show: ((layout as string) === "split") }}
tone={tone}
density={density}
landmarkLabel={landmarkLabel}
aside={(
<MediaFrame alt={(imageAlt ? imageAlt : title)} src={image} ratio="4/3" />
)}
>
{((proof as string) === "quote") ? (
<QuoteProof quote={quote?.text} quoteBy={quote?.by} center={center} />
) : null}
<CtaActions id={id} actions={actions} center={center} />
</SectionFrame>
)}
</>
);
}
// 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 CtaQuote = {
/** a customer quote, shown when `proof` is quote */
text?: string;
/** who said it */
by?: 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 cta-band// 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/cta-band.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"
)
// CtaBandProps are the props of CtaBand; the values are the JSON shapes of the TypeScript props.
type CtaBandProps struct {
Id any `json:"id"`
Title any `json:"title"`
Text any `json:"text"`
Actions any `json:"actions"`
Quote any `json:"quote"`
Layout any `json:"layout"`
Tone any `json:"tone"`
Proof any `json:"proof"`
Density any `json:"density"`
Image any `json:"image"`
ImageAlt any `json:"imageAlt"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof (none, quote), density.
templ CtaBand(p CtaBandProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vText := p.Text }}
{{ vActions := p.Actions }}
{{ vQuote := p.Quote }}
{{ vLayout := uiutils.Def(p.Layout, "card") }}
{{ vTone := uiutils.Def(p.Tone, "muted") }}
{{ vProof := uiutils.Def(p.Proof, "none") }}
{{ vDensity := uiutils.Def(p.Density, "default") }}
{{ vImage := p.Image }}
{{ vImageAlt := p.ImageAlt }}
{{ vLandmarkLabel := p.LandmarkLabel }}
{{ vCenter := any(uiutils.Or(uiutils.Eq(vLayout, "band"), uiutils.Eq(vLayout, "banner"))) }}
if uiutils.Eq(vLayout, "banner") {
@CtaBanner(CtaBannerProps{Id: vId, Title: vTitle, Text: vText, Cta: uiutils.Get(vActions, "cta"), Href: uiutils.Get(vActions, "href"), Tone: vTone, LandmarkLabel: vLandmarkLabel})
} else if uiutils.Eq(vLayout, "row") {
@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "section", Class: "py-8", Attrs: uiutils.Attrs("aria-labelledby", uiutils.Cond(uiutils.T(vLandmarkLabel), nil, uiutils.Tpl("{0}-title", vId)), "data-tone", vTone, "data-density", vDensity, "aria-label", vLandmarkLabel, "data-slot", "section")}}) {
@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: "mx-auto w-full max-w-6xl px-4", Attrs: uiutils.Attrs("data-slot", "container")}}) {
@compose.Card(compose.CardProps{Variant: "muted", BoxProps: box.BoxProps{}}) {
@compose.CardContent(compose.CardContentProps{BoxProps: box.BoxProps{Class: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between"}}) {
@compose.Stack(compose.StackProps{Gap: "2", BoxProps: box.BoxProps{Class: "min-w-0"}}) {
@compose.Title(compose.TitleProps{As: "2", Size: "2xl", Weight: "bold", TextProps: text.TextProps{Attrs: uiutils.Attrs("id", uiutils.Tpl("{0}-title", vId))}}) {
{ uiutils.Text(vTitle) }
}
@compose.Text(compose.TextProps{Size: "base", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(vText) }
}
}
if uiutils.Eq(vProof, "quote") {
@QuoteProof(QuoteProofProps{Quote: uiutils.Get(vQuote, "text"), QuoteBy: uiutils.Get(vQuote, "by"), Center: vCenter})
}
@CtaActions(CtaActionsProps{Id: vId, Actions: vActions, Center: vCenter})
}
}
}
}
} else {
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vText, Layout: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "split")), "split", "stack"), Align: uiutils.Cond(uiutils.T(vCenter), "center", "start"), Boxed: uiutils.Eq(vLayout, "card"), Media: map[string]any{"show": uiutils.Eq(vLayout, "split")}, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel, Aside: ctaBandFill1(p, vTitle, vImage, vImageAlt)}) {
if uiutils.Eq(vProof, "quote") {
@QuoteProof(QuoteProofProps{Quote: uiutils.Get(vQuote, "text"), QuoteBy: uiutils.Get(vQuote, "by"), Center: vCenter})
}
@CtaActions(CtaActionsProps{Id: vId, Actions: vActions, Center: vCenter})
}
}
}
templ ctaBandFill1(p CtaBandProps, vTitle any, vImage any, vImageAlt any) {
@MediaFrame(MediaFrameProps{Alt: uiutils.Cond(uiutils.T(vImageAlt), vImageAlt, vTitle), Src: vImage, Ratio: "4/3"})
}
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 cta-band{#- 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/cta-band.json
A closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof (none, quote), density.
Props (p): id, title, text, actions, quote, layout, tone, proof, density, image, imageAlt, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_text = (p.text ?? null) -%}
{%- set v_actions = (p.actions ?? null) -%}
{%- set v_quote = (p.quote ?? null) -%}
{%- set v_layout = (p.layout ?? 'card') -%}
{%- set v_tone = (p.tone ?? 'muted') -%}
{%- set v_proof = (p.proof ?? 'none') -%}
{%- set v_density = (p.density ?? 'default') -%}
{%- set v_image = (p.image ?? null) -%}
{%- set v_imageAlt = (p.imageAlt ?? null) -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set v_center = og_or([og_eq(v_layout, 'band'), og_eq(v_layout, 'banner')]) -%}
{%- if og_t(og_eq(v_layout, 'banner')) %}
{{ include('blocks/cta-banner.html.twig', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'cta': og_get(v_actions, ['cta']), 'href': og_get(v_actions, ['href']), 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
{%- elseif og_t(og_eq(v_layout, 'row')) %}
{%- set c_7 -%}
{%- set c_6 -%}
{%- set c_5 -%}
{%- set c_4 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ og_text(v_title) }}
{%- endset -%}
{{ include('compose/Title.html.twig', {'as': 2, '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': 'base', 'class': 'text-muted-foreground', 'children': c_2}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '2', 'class': 'min-w-0', 'children': c_3}, with_context = false) }}
{%- if og_t(og_eq(v_proof, 'quote')) %}
{{ include('blocks/quote-proof.html.twig', {'p': {'quote': og_get(v_quote, ['text']), 'quoteBy': og_get(v_quote, ['by']), 'center': v_center}}, with_context = false) }}
{%- endif %}
{{ include('blocks/cta-actions.html.twig', {'p': {'id': v_id, 'actions': v_actions, 'center': v_center}}, with_context = false) }}
{%- endset -%}
{{ include('compose/CardContent.html.twig', {'class': 'flex flex-col gap-4 md:flex-row md:items-center md:justify-between', 'children': c_4}, with_context = false) }}
{%- endset -%}
{{ include('compose/Card.html.twig', {'variant': 'muted', 'children': c_5}, with_context = false) }}
{%- endset -%}
{{ include('compose/Container.html.twig', {'class': 'mx-auto w-full max-w-6xl px-4', 'attrs': og_attrs(['data-slot', 'container']), 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'section', 'class': 'py-8', 'attrs': og_attrs(['aria-labelledby', (og_t(v_landmarkLabel) ? null : og_tpl('{0}-title', [v_id])), 'data-tone', v_tone, 'data-density', v_density, 'aria-label', v_landmarkLabel, 'data-slot', 'section']), 'children': c_7}, with_context = false) }}
{%- else %}
{%- set f_8 -%}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': (og_t(v_imageAlt) ? v_imageAlt : v_title), 'src': v_image, 'ratio': '4/3'}}, with_context = false) }}
{%- endset -%}
{%- set c_9 -%}
{%- if og_t(og_eq(v_proof, 'quote')) %}
{{ include('blocks/quote-proof.html.twig', {'p': {'quote': og_get(v_quote, ['text']), 'quoteBy': og_get(v_quote, ['by']), 'center': v_center}}, with_context = false) }}
{%- endif %}
{{ include('blocks/cta-actions.html.twig', {'p': {'id': v_id, 'actions': v_actions, 'center': v_center}}, with_context = false) }}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'lead': v_text, 'layout': (og_t(og_eq(v_layout, 'split')) ? 'split' : 'stack'), 'align': (og_t(v_center) ? 'center' : 'start'), 'boxed': og_eq(v_layout, 'card'), 'media': {'show': og_eq(v_layout, 'split')}, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_8)}, 'children': og_markup(c_9)}, with_context = false) }}
{%- endif %}
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 cta-band{* 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/cta-band.json
A closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof (none, quote), density.
Props (p): id, title, text, actions, quote, layout, tone, proof, density, image, imageAlt, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_text = ($p['text'] ?? null)}
{var $v_actions = ($p['actions'] ?? null)}
{var $v_quote = ($p['quote'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'card')}
{var $v_tone = ($p['tone'] ?? 'muted')}
{var $v_proof = ($p['proof'] ?? 'none')}
{var $v_density = ($p['density'] ?? 'default')}
{var $v_image = ($p['image'] ?? null)}
{var $v_imageAlt = ($p['imageAlt'] ?? null)}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{var $v_center = og_or([og_eq($v_layout, 'band'), og_eq($v_layout, 'banner')])}
{if og_t(og_eq($v_layout, 'banner'))}
{=og_include('blocks/cta-banner.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'text' => $v_text, 'cta' => og_get($v_actions, ['cta']), 'href' => og_get($v_actions, ['href']), 'tone' => $v_tone, 'landmarkLabel' => $v_landmarkLabel]])|noescape}
{elseif og_t(og_eq($v_layout, 'row'))}
{capture $c_7}
{capture $c_6}
{capture $c_5}
{capture $c_4}
{capture $c_3}
{capture $c_1}
{=og_text($v_title)}
{/capture}
{=og_include('compose/Title.latte', ['as' => 2, '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' => 'base', 'class' => 'text-muted-foreground', 'children' => (string) $c_2])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '2', 'class' => 'min-w-0', 'children' => (string) $c_3])|noescape}
{if og_t(og_eq($v_proof, 'quote'))}
{=og_include('blocks/quote-proof.latte', ['p' => ['quote' => og_get($v_quote, ['text']), 'quoteBy' => og_get($v_quote, ['by']), 'center' => $v_center]])|noescape}
{/if}
{=og_include('blocks/cta-actions.latte', ['p' => ['id' => $v_id, 'actions' => $v_actions, 'center' => $v_center]])|noescape}
{/capture}
{=og_include('compose/CardContent.latte', ['class' => 'flex flex-col gap-4 md:flex-row md:items-center md:justify-between', 'children' => (string) $c_4])|noescape}
{/capture}
{=og_include('compose/Card.latte', ['variant' => 'muted', 'children' => (string) $c_5])|noescape}
{/capture}
{=og_include('compose/Container.latte', ['class' => 'mx-auto w-full max-w-6xl px-4', 'attrs' => og_attrs(['data-slot', 'container']), 'children' => (string) $c_6])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'section', 'class' => 'py-8', 'attrs' => og_attrs(['aria-labelledby', (og_t($v_landmarkLabel) ? null : og_tpl('{0}-title', [$v_id])), 'data-tone', $v_tone, 'data-density', $v_density, 'aria-label', $v_landmarkLabel, 'data-slot', 'section']), 'children' => (string) $c_7])|noescape}
{else}
{capture $f_8}
{=og_include('blocks/media-frame.latte', ['p' => ['alt' => (og_t($v_imageAlt) ? $v_imageAlt : $v_title), 'src' => $v_image, 'ratio' => '4/3']])|noescape}
{/capture}
{capture $c_9}
{if og_t(og_eq($v_proof, 'quote'))}
{=og_include('blocks/quote-proof.latte', ['p' => ['quote' => og_get($v_quote, ['text']), 'quoteBy' => og_get($v_quote, ['by']), 'center' => $v_center]])|noescape}
{/if}
{=og_include('blocks/cta-actions.latte', ['p' => ['id' => $v_id, 'actions' => $v_actions, 'center' => $v_center]])|noescape}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'lead' => $v_text, 'layout' => (og_t(og_eq($v_layout, 'split')) ? 'split' : 'stack'), 'align' => (og_t($v_center) ? 'center' : 'start'), 'boxed' => og_eq($v_layout, 'card'), 'media' => ['show' => og_eq($v_layout, 'split')], 'tone' => $v_tone, 'density' => $v_density, 'landmarkLabel' => $v_landmarkLabel, 'aside' => og_markup($f_8)], 'children' => og_markup($c_9)])|noescape}
{/if}
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 cta-band{#- 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/cta-band.json
A closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof (none, quote), density.
Props (p): id, title, text, actions, quote, layout, tone, proof, density, image, imageAlt, 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_actions = og_def(p['actions'], none) -%}
{%- set v_quote = og_def(p['quote'], none) -%}
{%- set v_layout = og_def(p['layout'], 'card') -%}
{%- set v_tone = og_def(p['tone'], 'muted') -%}
{%- set v_proof = og_def(p['proof'], 'none') -%}
{%- set v_density = og_def(p['density'], 'default') -%}
{%- set v_image = og_def(p['image'], none) -%}
{%- set v_imageAlt = og_def(p['imageAlt'], none) -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set v_center = og_or([og_eq(v_layout, 'band'), og_eq(v_layout, 'banner')]) -%}
{%- if og_t(og_eq(v_layout, 'banner')) %}
{{ og_include('blocks/cta-banner.html.j2', {'p': {'id': v_id, 'title': v_title, 'text': v_text, 'cta': og_get(v_actions, ['cta']), 'href': og_get(v_actions, ['href']), 'tone': v_tone, 'landmarkLabel': v_landmarkLabel}}) }}
{%- elif og_t(og_eq(v_layout, 'row')) %}
{%- set c_7 -%}
{%- set c_6 -%}
{%- set c_5 -%}
{%- set c_4 -%}
{%- set c_3 -%}
{%- set c_1 -%}
{{ og_text(v_title) }}
{%- endset -%}
{{ og_include('compose/title.html.j2', {'p': {'As': 2, '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': 'base', 'Class': 'text-muted-foreground'}, 'children': c_2}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '2', 'Class': 'min-w-0'}, 'children': c_3}) }}
{%- if og_t(og_eq(v_proof, 'quote')) %}
{{ og_include('blocks/quote-proof.html.j2', {'p': {'quote': og_get(v_quote, ['text']), 'quoteBy': og_get(v_quote, ['by']), 'center': v_center}}) }}
{%- endif %}
{{ og_include('blocks/cta-actions.html.j2', {'p': {'id': v_id, 'actions': v_actions, 'center': v_center}}) }}
{%- endset -%}
{{ og_include('compose/card-content.html.j2', {'p': {'Class': 'flex flex-col gap-4 md:flex-row md:items-center md:justify-between'}, 'children': c_4}) }}
{%- endset -%}
{{ og_include('compose/card.html.j2', {'p': {'Variant': 'muted'}, 'children': c_5}) }}
{%- endset -%}
{{ og_include('compose/container.html.j2', {'p': {'Class': 'mx-auto w-full max-w-6xl px-4', 'Attrs': og_attrs(['data-slot', 'container'])}, 'children': c_6}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'section', 'Class': 'py-8', 'Attrs': og_attrs(['aria-labelledby', (none if og_t(v_landmarkLabel) else og_tpl('{0}-title', [v_id])), 'data-tone', v_tone, 'data-density', v_density, 'aria-label', v_landmarkLabel, 'data-slot', 'section'])}, 'children': c_7}) }}
{%- else %}
{%- set f_8 -%}
{{ og_include('blocks/media-frame.html.j2', {'p': {'alt': (v_imageAlt if og_t(v_imageAlt) else v_title), 'src': v_image, 'ratio': '4/3'}}) }}
{%- endset -%}
{%- set c_9 -%}
{%- if og_t(og_eq(v_proof, 'quote')) %}
{{ og_include('blocks/quote-proof.html.j2', {'p': {'quote': og_get(v_quote, ['text']), 'quoteBy': og_get(v_quote, ['by']), 'center': v_center}}) }}
{%- endif %}
{{ og_include('blocks/cta-actions.html.j2', {'p': {'id': v_id, 'actions': v_actions, 'center': v_center}}) }}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'lead': v_text, 'layout': ('split' if og_t(og_eq(v_layout, 'split')) else 'stack'), 'align': ('center' if og_t(v_center) else 'start'), 'boxed': og_eq(v_layout, 'card'), 'media': {'show': og_eq(v_layout, 'split')}, 'tone': v_tone, 'density': v_density, 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_8)}, 'children': og_markup(c_9)}) }}
{%- endif %}
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 closing call to action: a heading, one sentence and one or two links. Axes: layout (card, band, split picture, row: heading beside the button in a card), tone, actions (one, two, form: an email field), proof (none, quote), density.
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | |
| title (required) | string | - | |
| text (required) | string | - | |
| actions (required) | ActionSet | - | the links (mode one or two) or the email field (mode form) |
| quote | CtaQuote | - | |
| layout | "card" | "band" | "split" | "row" | "banner" | "card" | card: boxed; band: full-width; split: text beside picture; row: heading beside button; banner: centered muted card with one button |
| tone | "default" | "muted" | "muted" | |
| proof | "none" | "quote" | "none" | |
| density | "roomy" | "default" | "compact" | "default" | |
| image | string | - | address of the picture (an https URL or a path); none: the placeholder |
| imageAlt | string | - | alt text of the picture; none: the title |
| 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 |