Hero Prompt
Heading, lead, one or two actions and optional media.
Install
npx ui8kit add hero-promptPulls in: action-group, block, compose, container, cta-actions, hero-badge, hero-head, kit-box, nav-bar, presets, prompt-composer, stack, topic-chips, utils, weighted-title
Preview
No static preview for this item: it needs content or a parent that this page cannot supply. The code is below.
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 hero-prompt<!-- 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 dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic
pills.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { HeroComposer, HeroNav } from "./hero-prompt.types";
import type { ActionSet } from "../components/cta-actions.types";
import type { NavLink } from "./nav-bar.types";
import type { Topic } from "../components/topic-chips.types";
export type HeroPromptProps = {
title: string;
level?: 1 | 2;
badge?: string;
badgeMark?: string;
actions?: ActionSet;
composer?: HeroComposer;
nav?: HeroNav;
topics?: Topic[];
density?: "roomy" | "default" | "compact";
landmarkLabel?: string;
};
</script>
<script lang="ts">
import Block from "../compose/Block.svelte";
import Container from "../compose/Container.svelte";
import Stack from "../compose/Stack.svelte";
import ActionGroup from "../components/action-group.svelte";
import HeroBadge from "../components/hero-badge.svelte";
import HeroHead from "../components/hero-head.svelte";
import PromptComposer from "../components/prompt-composer.svelte";
import TopicChips from "../components/topic-chips.svelte";
import WeightedTitle from "../components/weighted-title.svelte";
import { defaults } from "../presets/defaults";
import { cn } from "../utils";
let {
title,
level = 1,
badge,
badgeMark,
actions,
composer,
nav,
topics,
density = "roomy",
landmarkLabel,
}: HeroPromptProps = $props();
</script>
<Block
tag="section"
class={cn(
"flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70",
defaults.hero.band
)}
aria-labelledby={(landmarkLabel ? undefined : "home-hero-title")}
data-tone="inverse"
data-density={density}
data-chrome="nav"
aria-label={landmarkLabel}
data-slot="section"
>
<Container class={cn("mx-auto w-full px-8", defaults.hero.container)} data-slot="container">
<Stack gap="0" align="stretch">
<HeroHead
brand={nav?.brand}
links={nav?.links}
current={nav?.current}
login={nav?.login}
loginHref={nav?.loginHref}
skip={nav?.skip}
navLabel={nav?.label}
cta={actions?.cta}
href={actions?.href}
landmarkLabel={landmarkLabel}
/>
<Stack
gap="0"
align="center"
class={cn("mx-auto w-full pt-24 pb-16", defaults.hero.column)}
data-slot="hero-column"
>
{#if badge}
<HeroBadge label={badge} mark={badgeMark} />
{/if}
<WeightedTitle id="home-hero-title" title={title} weights={defaults.hero.titleWeights} level={level} />
{#if (actions?.mode === "form")}
<PromptComposer
label={actions?.emailLabel}
attachLabel={composer?.attachLabel}
modelLabel={composer?.modelLabel}
send={actions?.cta}
href={actions?.href}
/>
{:else if actions?.cta}
<ActionGroup
primary={actions?.cta}
primaryHref={actions?.href}
secondary={((actions?.mode === "two") ? actions?.secondary : undefined)}
secondaryHref={actions?.secondaryHref}
align={(true ? "center" : "start")}
/>
{/if}
{#if (topics && ((topics?.length ?? 0) > 0))}
<TopicChips topics={topics} tone="inverse" />
{/if}
</Stack>
</Stack>
</Container>
</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.
import type { NavLink } from "./nav-bar.types";
export type HeroComposer = {
/** attachment chip label */
attachLabel?: string;
/** model pill label */
modelLabel?: string;
};
export type HeroNav = {
/** brand word of the head row */
brand?: string;
/** menu links of the head row */
links?: NavLink[];
/** id of the current link */
current?: string;
login?: string;
loginHref?: string;
/** skip link text */
skip?: string;
/** accessible name of the menu */
label?: 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 hero-prompt// 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 dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic
* pills.
*/
import { type ReactNode } from "react";
import { Block, Container, Stack } from "../compose";
import { ActionGroup } from "../components/action-group";
import { HeroBadge } from "../components/hero-badge";
import { HeroHead } from "../components/hero-head";
import { PromptComposer } from "../components/prompt-composer";
import { TopicChips } from "../components/topic-chips";
import { WeightedTitle } from "../components/weighted-title";
import { defaults } from "../presets/defaults";
import { cn } from "../utils";
import type { HeroComposer, HeroNav } from "./hero-prompt.types";
import type { ActionSet } from "../components/cta-actions.types";
import type { NavLink } from "./nav-bar.types";
import type { Topic } from "../components/topic-chips.types";
export type HeroPromptProps = {
title: string;
level?: 1 | 2;
badge?: string;
badgeMark?: string;
actions?: ActionSet;
composer?: HeroComposer;
nav?: HeroNav;
topics?: Topic[];
density?: "roomy" | "default" | "compact";
landmarkLabel?: string;
};
export function HeroPrompt({
title,
level = 1,
badge,
badgeMark,
actions,
composer,
nav,
topics,
density = "roomy",
landmarkLabel,
}: HeroPromptProps) {
return (
<Block
tag="section"
className={cn(
"flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70",
defaults.hero.band
)}
aria-labelledby={(landmarkLabel ? undefined : "home-hero-title")}
data-tone="inverse"
data-density={density}
data-chrome="nav"
aria-label={landmarkLabel}
data-slot="section"
>
<Container className={cn("mx-auto w-full px-8", defaults.hero.container)} data-slot="container">
<Stack gap="0" align="stretch">
<HeroHead
brand={nav?.brand}
links={nav?.links}
current={nav?.current}
login={nav?.login}
loginHref={nav?.loginHref}
skip={nav?.skip}
navLabel={nav?.label}
cta={actions?.cta}
href={actions?.href}
landmarkLabel={landmarkLabel}
/>
<Stack
gap="0"
align="center"
className={cn("mx-auto w-full pt-24 pb-16", defaults.hero.column)}
data-slot="hero-column"
>
{badge ? (
<HeroBadge label={badge} mark={badgeMark} />
) : null}
<WeightedTitle id="home-hero-title" title={title} weights={defaults.hero.titleWeights} level={level} />
{(actions?.mode === "form") ? (
<PromptComposer
label={actions?.emailLabel}
attachLabel={composer?.attachLabel}
modelLabel={composer?.modelLabel}
send={actions?.cta}
href={actions?.href}
/>
) : actions?.cta ? (
<ActionGroup
primary={actions?.cta}
primaryHref={actions?.href}
secondary={((actions?.mode === "two") ? actions?.secondary : undefined)}
secondaryHref={actions?.secondaryHref}
align={(true ? "center" : "start")}
/>
) : null}
{(topics && ((topics?.length ?? 0) > 0)) ? (
<TopicChips topics={topics} tone="inverse" />
) : null}
</Stack>
</Stack>
</Container>
</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.
import type { NavLink } from "./nav-bar.types";
export type HeroComposer = {
/** attachment chip label */
attachLabel?: string;
/** model pill label */
modelLabel?: string;
};
export type HeroNav = {
/** brand word of the head row */
brand?: string;
/** menu links of the head row */
links?: NavLink[];
/** id of the current link */
current?: string;
login?: string;
loginHref?: string;
/** skip link text */
skip?: string;
/** accessible name of the menu */
label?: 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 hero-prompt// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.
import type { NavLink } from "./nav-bar.types";
export type HeroComposer = {
/** attachment chip label */
attachLabel?: string;
/** model pill label */
modelLabel?: string;
};
export type HeroNav = {
/** brand word of the head row */
brand?: string;
/** menu links of the head row */
links?: NavLink[];
/** id of the current link */
current?: string;
login?: string;
loginHref?: string;
/** skip link text */
skip?: string;
/** accessible name of the menu */
label?: 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 dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic
pills.
-->
<script lang="ts">
import type { HeroComposer, HeroNav } from "./hero-prompt.types";
import type { ActionSet } from "../components/cta-actions.types";
import type { NavLink } from "./nav-bar.types";
import type { Topic } from "../components/topic-chips.types";
export type HeroPromptProps = {
title: string;
level?: 1 | 2;
badge?: string;
badgeMark?: string;
actions?: ActionSet;
composer?: HeroComposer;
nav?: HeroNav;
topics?: Topic[];
density?: "roomy" | "default" | "compact";
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import Block from "../compose/Block.vue";
import Container from "../compose/Container.vue";
import Stack from "../compose/Stack.vue";
import ActionGroup from "../components/action-group.vue";
import HeroBadge from "../components/hero-badge.vue";
import HeroHead from "../components/hero-head.vue";
import PromptComposer from "../components/prompt-composer.vue";
import TopicChips from "../components/topic-chips.vue";
import WeightedTitle from "../components/weighted-title.vue";
import { defaults } from "../presets/defaults";
import { cn } from "../utils";
const {
title,
level = 1,
badge,
badgeMark,
actions,
composer,
nav,
topics,
density = "roomy",
landmarkLabel,
} = defineProps<HeroPromptProps>();
</script>
<template>
<Block
tag="section"
:class="cn(
'flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70',
defaults.hero.band
)"
:aria-labelledby="(landmarkLabel ? undefined : 'home-hero-title')"
data-tone="inverse"
:data-density="density"
data-chrome="nav"
:aria-label="landmarkLabel"
data-slot="section"
>
<Container :class="cn('mx-auto w-full px-8', defaults.hero.container)" data-slot="container">
<Stack gap="0" align="stretch">
<HeroHead
:brand="nav?.brand"
:links="nav?.links"
:current="nav?.current"
:login="nav?.login"
:loginHref="nav?.loginHref"
:skip="nav?.skip"
:navLabel="nav?.label"
:cta="actions?.cta"
:href="actions?.href"
:landmarkLabel="landmarkLabel"
/>
<Stack
gap="0"
align="center"
:class="cn('mx-auto w-full pt-24 pb-16', defaults.hero.column)"
data-slot="hero-column"
>
<HeroBadge v-if="badge" :label="badge" :mark="badgeMark" />
<WeightedTitle id="home-hero-title" :title="title" :weights="defaults.hero.titleWeights" :level="level" />
<PromptComposer v-if="(actions?.mode === 'form')"
:label="actions?.emailLabel"
:attachLabel="composer?.attachLabel"
:modelLabel="composer?.modelLabel"
:send="actions?.cta"
:href="actions?.href"
/>
<ActionGroup v-else-if="actions?.cta"
:primary="actions?.cta"
:primaryHref="actions?.href"
:secondary="((actions?.mode === 'two') ? actions?.secondary : undefined)"
:secondaryHref="actions?.secondaryHref"
:align="(true ? 'center' : 'start')"
/>
<TopicChips v-if="(topics && ((topics?.length ?? 0) > 0))" :topics="topics" tone="inverse" />
</Stack>
</Stack>
</Container>
</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 hero-prompt// 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 dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic
* pills.
*/
import { type JSX } from "solid-js";
import { Block, Container, Stack } from "../compose";
import { ActionGroup } from "../components/action-group";
import { HeroBadge } from "../components/hero-badge";
import { HeroHead } from "../components/hero-head";
import { PromptComposer } from "../components/prompt-composer";
import { TopicChips } from "../components/topic-chips";
import { WeightedTitle } from "../components/weighted-title";
import { defaults } from "../presets/defaults";
import { cn } from "../utils";
import type { HeroComposer, HeroNav } from "./hero-prompt.types";
import type { ActionSet } from "../components/cta-actions.types";
import type { NavLink } from "./nav-bar.types";
import type { Topic } from "../components/topic-chips.types";
export type HeroPromptProps = {
title: string;
level?: 1 | 2;
badge?: string;
badgeMark?: string;
actions?: ActionSet;
composer?: HeroComposer;
nav?: HeroNav;
topics?: Topic[];
density?: "roomy" | "default" | "compact";
landmarkLabel?: string;
};
export function HeroPrompt({
title,
level = 1,
badge,
badgeMark,
actions,
composer,
nav,
topics,
density = "roomy",
landmarkLabel,
}: HeroPromptProps) {
return (
<Block
tag="section"
class={cn(
"flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70",
defaults.hero.band
)}
aria-labelledby={(landmarkLabel ? undefined : "home-hero-title")}
data-tone="inverse"
data-density={density}
data-chrome="nav"
aria-label={landmarkLabel}
data-slot="section"
>
<Container class={cn("mx-auto w-full px-8", defaults.hero.container)} data-slot="container">
<Stack gap="0" align="stretch">
<HeroHead
brand={nav?.brand}
links={nav?.links}
current={nav?.current}
login={nav?.login}
loginHref={nav?.loginHref}
skip={nav?.skip}
navLabel={nav?.label}
cta={actions?.cta}
href={actions?.href}
landmarkLabel={landmarkLabel}
/>
<Stack
gap="0"
align="center"
class={cn("mx-auto w-full pt-24 pb-16", defaults.hero.column)}
data-slot="hero-column"
>
{badge ? (
<HeroBadge label={badge} mark={badgeMark} />
) : null}
<WeightedTitle id="home-hero-title" title={title} weights={defaults.hero.titleWeights} level={level} />
{(actions?.mode === "form") ? (
<PromptComposer
label={actions?.emailLabel}
attachLabel={composer?.attachLabel}
modelLabel={composer?.modelLabel}
send={actions?.cta}
href={actions?.href}
/>
) : actions?.cta ? (
<ActionGroup
primary={actions?.cta}
primaryHref={actions?.href}
secondary={((actions?.mode === "two") ? actions?.secondary : undefined)}
secondaryHref={actions?.secondaryHref}
align={(true ? "center" : "start")}
/>
) : null}
{(topics && ((topics?.length ?? 0) > 0)) ? (
<TopicChips topics={topics} tone="inverse" />
) : null}
</Stack>
</Stack>
</Container>
</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.
import type { NavLink } from "./nav-bar.types";
export type HeroComposer = {
/** attachment chip label */
attachLabel?: string;
/** model pill label */
modelLabel?: string;
};
export type HeroNav = {
/** brand word of the head row */
brand?: string;
/** menu links of the head row */
links?: NavLink[];
/** id of the current link */
current?: string;
login?: string;
loginHref?: string;
/** skip link text */
skip?: string;
/** accessible name of the menu */
label?: 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 hero-prompt// 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/hero-prompt.json
package blocks
import (
"github.com/ui8kit/codegen/generated/templ/ui/box"
"github.com/ui8kit/codegen/generated/templ/compose"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// HeroPromptProps are the props of HeroPrompt; the values are the JSON shapes of the TypeScript props.
type HeroPromptProps struct {
Title any `json:"title"`
Level any `json:"level"`
Badge any `json:"badge"`
BadgeMark any `json:"badgeMark"`
Actions any `json:"actions"`
Composer any `json:"composer"`
Nav any `json:"nav"`
Topics any `json:"topics"`
Density any `json:"density"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic pills.
templ HeroPrompt(p HeroPromptProps) {
{{ vTitle := p.Title }}
{{ vLevel := uiutils.Def(p.Level, float64(1)) }}
{{ vBadge := p.Badge }}
{{ vBadgeMark := p.BadgeMark }}
{{ vActions := p.Actions }}
{{ vComposer := p.Composer }}
{{ vNav := p.Nav }}
{{ vTopics := p.Topics }}
{{ vDensity := uiutils.Def(p.Density, "roomy") }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@compose.Block(compose.BlockProps{BoxProps: box.BoxProps{Tag: "section", Class: uiutils.S(uiutils.Cnv("flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70", uiutils.Get(presetDefaults, "hero", "band"))), Attrs: uiutils.Attrs("aria-labelledby", uiutils.Cond(uiutils.T(vLandmarkLabel), nil, "home-hero-title"), "data-tone", "inverse", "data-density", vDensity, "data-chrome", "nav", "aria-label", vLandmarkLabel, "data-slot", "section")}}) {
@compose.Container(compose.ContainerProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("mx-auto w-full px-8", uiutils.Get(presetDefaults, "hero", "container"))), Attrs: uiutils.Attrs("data-slot", "container")}}) {
@compose.Stack(compose.StackProps{Gap: "0", Align: "stretch", BoxProps: box.BoxProps{}}) {
@HeroHead(HeroHeadProps{Brand: uiutils.Get(vNav, "brand"), Links: uiutils.Get(vNav, "links"), Current: uiutils.Get(vNav, "current"), Login: uiutils.Get(vNav, "login"), LoginHref: uiutils.Get(vNav, "loginHref"), Skip: uiutils.Get(vNav, "skip"), NavLabel: uiutils.Get(vNav, "label"), Cta: uiutils.Get(vActions, "cta"), Href: uiutils.Get(vActions, "href"), LandmarkLabel: vLandmarkLabel})
@compose.Stack(compose.StackProps{Gap: "0", Align: "center", BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("mx-auto w-full pt-24 pb-16", uiutils.Get(presetDefaults, "hero", "column"))), Attrs: uiutils.Attrs("data-slot", "hero-column")}}) {
if uiutils.T(vBadge) {
@HeroBadge(HeroBadgeProps{Label: vBadge, Mark: vBadgeMark})
}
@WeightedTitle(WeightedTitleProps{Id: "home-hero-title", Title: vTitle, Weights: uiutils.Get(presetDefaults, "hero", "titleWeights"), Level: vLevel})
if uiutils.Eq(uiutils.Get(vActions, "mode"), "form") {
@PromptComposer(PromptComposerProps{Label: uiutils.Get(vActions, "emailLabel"), AttachLabel: uiutils.Get(vComposer, "attachLabel"), ModelLabel: uiutils.Get(vComposer, "modelLabel"), Send: uiutils.Get(vActions, "cta"), Href: uiutils.Get(vActions, "href")})
} else if uiutils.T(uiutils.Get(vActions, "cta")) {
@ActionGroup(ActionGroupProps{Primary: uiutils.Get(vActions, "cta"), PrimaryHref: uiutils.Get(vActions, "href"), Secondary: uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vActions, "mode"), "two")), uiutils.Get(vActions, "secondary"), nil), SecondaryHref: uiutils.Get(vActions, "secondaryHref"), Align: uiutils.Cond(uiutils.T(true), "center", "start")})
}
if uiutils.T(uiutils.And(vTopics, uiutils.Gt(uiutils.Len(vTopics), float64(0)))) {
@TopicChips(TopicChipsProps{Topics: vTopics, Tone: "inverse"})
}
}
}
}
}
}
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 hero-prompt{#- 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/hero-prompt.json
A dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic pills.
Props (p): title, level, badge, badgeMark, actions, composer, nav, topics, density, landmarkLabel. -#}
{%- set v_title = (p.title ?? null) -%}
{%- set v_level = (p.level ?? 1) -%}
{%- set v_badge = (p.badge ?? null) -%}
{%- set v_badgeMark = (p.badgeMark ?? null) -%}
{%- set v_actions = (p.actions ?? null) -%}
{%- set v_composer = (p.composer ?? null) -%}
{%- set v_nav = (p.nav ?? null) -%}
{%- set v_topics = (p.topics ?? null) -%}
{%- set v_density = (p.density ?? 'roomy') -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set c_4 -%}
{%- set c_3 -%}
{%- set c_2 -%}
{{ include('blocks/hero-head.html.twig', {'p': {'brand': og_get(v_nav, ['brand']), 'links': og_get(v_nav, ['links']), 'current': og_get(v_nav, ['current']), 'login': og_get(v_nav, ['login']), 'loginHref': og_get(v_nav, ['loginHref']), 'skip': og_get(v_nav, ['skip']), 'navLabel': og_get(v_nav, ['label']), 'cta': og_get(v_actions, ['cta']), 'href': og_get(v_actions, ['href']), 'landmarkLabel': v_landmarkLabel}}, with_context = false) }}
{%- set c_1 -%}
{%- if og_t(v_badge) %}
{{ include('blocks/hero-badge.html.twig', {'p': {'label': v_badge, 'mark': v_badgeMark}}, with_context = false) }}
{%- endif %}
{{ include('blocks/weighted-title.html.twig', {'p': {'id': 'home-hero-title', 'title': v_title, 'weights': og_preset('blocks/presets/defaults.json', ['hero', 'titleWeights']), 'level': v_level}}, with_context = false) }}
{%- if og_t(og_eq(og_get(v_actions, ['mode']), 'form')) %}
{{ include('blocks/prompt-composer.html.twig', {'p': {'label': og_get(v_actions, ['emailLabel']), 'attachLabel': og_get(v_composer, ['attachLabel']), 'modelLabel': og_get(v_composer, ['modelLabel']), 'send': og_get(v_actions, ['cta']), 'href': og_get(v_actions, ['href'])}}, with_context = false) }}
{%- elseif og_t(og_get(v_actions, ['cta'])) %}
{{ include('blocks/action-group.html.twig', {'p': {'primary': og_get(v_actions, ['cta']), 'primaryHref': og_get(v_actions, ['href']), 'secondary': (og_t(og_eq(og_get(v_actions, ['mode']), 'two')) ? og_get(v_actions, ['secondary']) : null), 'secondaryHref': og_get(v_actions, ['secondaryHref']), 'align': (og_t(true) ? 'center' : 'start')}}, with_context = false) }}
{%- endif %}
{%- if og_t(og_and([v_topics, og_gt(og_len(v_topics), 0)])) %}
{{ include('blocks/topic-chips.html.twig', {'p': {'topics': v_topics, 'tone': 'inverse'}}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '0', 'align': 'center', 'class': og_s(og_cnv(['mx-auto w-full pt-24 pb-16', og_preset('blocks/presets/defaults.json', ['hero', 'column'])])), 'attrs': og_attrs(['data-slot', 'hero-column']), 'children': c_1}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '0', 'align': 'stretch', 'children': c_2}, with_context = false) }}
{%- endset -%}
{{ include('compose/Container.html.twig', {'class': og_s(og_cnv(['mx-auto w-full px-8', og_preset('blocks/presets/defaults.json', ['hero', 'container'])])), 'attrs': og_attrs(['data-slot', 'container']), 'children': c_3}, with_context = false) }}
{%- endset -%}
{{ include('compose/Block.html.twig', {'tag': 'section', 'class': og_s(og_cnv(['flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70', og_preset('blocks/presets/defaults.json', ['hero', 'band'])])), 'attrs': og_attrs(['aria-labelledby', (og_t(v_landmarkLabel) ? null : 'home-hero-title'), 'data-tone', 'inverse', 'data-density', v_density, 'data-chrome', 'nav', 'aria-label', v_landmarkLabel, 'data-slot', 'section']), 'children': c_4}, 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 hero-prompt{* 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/hero-prompt.json
A dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic pills.
Props (p): title, level, badge, badgeMark, actions, composer, nav, topics, density, landmarkLabel. *}
{var $v_title = ($p['title'] ?? null)}
{var $v_level = ($p['level'] ?? 1)}
{var $v_badge = ($p['badge'] ?? null)}
{var $v_badgeMark = ($p['badgeMark'] ?? null)}
{var $v_actions = ($p['actions'] ?? null)}
{var $v_composer = ($p['composer'] ?? null)}
{var $v_nav = ($p['nav'] ?? null)}
{var $v_topics = ($p['topics'] ?? null)}
{var $v_density = ($p['density'] ?? 'roomy')}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $c_4}
{capture $c_3}
{capture $c_2}
{=og_include('blocks/hero-head.latte', ['p' => ['brand' => og_get($v_nav, ['brand']), 'links' => og_get($v_nav, ['links']), 'current' => og_get($v_nav, ['current']), 'login' => og_get($v_nav, ['login']), 'loginHref' => og_get($v_nav, ['loginHref']), 'skip' => og_get($v_nav, ['skip']), 'navLabel' => og_get($v_nav, ['label']), 'cta' => og_get($v_actions, ['cta']), 'href' => og_get($v_actions, ['href']), 'landmarkLabel' => $v_landmarkLabel]])|noescape}
{capture $c_1}
{if og_t($v_badge)}
{=og_include('blocks/hero-badge.latte', ['p' => ['label' => $v_badge, 'mark' => $v_badgeMark]])|noescape}
{/if}
{=og_include('blocks/weighted-title.latte', ['p' => ['id' => 'home-hero-title', 'title' => $v_title, 'weights' => og_preset('blocks/presets/defaults.json', ['hero', 'titleWeights']), 'level' => $v_level]])|noescape}
{if og_t(og_eq(og_get($v_actions, ['mode']), 'form'))}
{=og_include('blocks/prompt-composer.latte', ['p' => ['label' => og_get($v_actions, ['emailLabel']), 'attachLabel' => og_get($v_composer, ['attachLabel']), 'modelLabel' => og_get($v_composer, ['modelLabel']), 'send' => og_get($v_actions, ['cta']), 'href' => og_get($v_actions, ['href'])]])|noescape}
{elseif og_t(og_get($v_actions, ['cta']))}
{=og_include('blocks/action-group.latte', ['p' => ['primary' => og_get($v_actions, ['cta']), 'primaryHref' => og_get($v_actions, ['href']), 'secondary' => (og_t(og_eq(og_get($v_actions, ['mode']), 'two')) ? og_get($v_actions, ['secondary']) : null), 'secondaryHref' => og_get($v_actions, ['secondaryHref']), 'align' => (og_t(true) ? 'center' : 'start')]])|noescape}
{/if}
{if og_t(og_and([$v_topics, og_gt(og_len($v_topics), 0)]))}
{=og_include('blocks/topic-chips.latte', ['p' => ['topics' => $v_topics, 'tone' => 'inverse']])|noescape}
{/if}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '0', 'align' => 'center', 'class' => og_s(og_cnv(['mx-auto w-full pt-24 pb-16', og_preset('blocks/presets/defaults.json', ['hero', 'column'])])), 'attrs' => og_attrs(['data-slot', 'hero-column']), 'children' => (string) $c_1])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '0', 'align' => 'stretch', 'children' => (string) $c_2])|noescape}
{/capture}
{=og_include('compose/Container.latte', ['class' => og_s(og_cnv(['mx-auto w-full px-8', og_preset('blocks/presets/defaults.json', ['hero', 'container'])])), 'attrs' => og_attrs(['data-slot', 'container']), 'children' => (string) $c_3])|noescape}
{/capture}
{=og_include('compose/Block.latte', ['tag' => 'section', 'class' => og_s(og_cnv(['flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70', og_preset('blocks/presets/defaults.json', ['hero', 'band'])])), 'attrs' => og_attrs(['aria-labelledby', (og_t($v_landmarkLabel) ? null : 'home-hero-title'), 'data-tone', 'inverse', 'data-density', $v_density, 'data-chrome', 'nav', 'aria-label', $v_landmarkLabel, 'data-slot', 'section']), 'children' => (string) $c_4])|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 hero-prompt{#- 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/hero-prompt.json
A dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic pills.
Props (p): title, level, badge, badgeMark, actions, composer, nav, topics, density, landmarkLabel. -#}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_level = og_def(p['level'], 1) -%}
{%- set v_badge = og_def(p['badge'], none) -%}
{%- set v_badgeMark = og_def(p['badgeMark'], none) -%}
{%- set v_actions = og_def(p['actions'], none) -%}
{%- set v_composer = og_def(p['composer'], none) -%}
{%- set v_nav = og_def(p['nav'], none) -%}
{%- set v_topics = og_def(p['topics'], none) -%}
{%- set v_density = og_def(p['density'], 'roomy') -%}
{%- set v_landmarkLabel = og_def(p['landmarkLabel'], none) -%}
{%- set c_4 -%}
{%- set c_3 -%}
{%- set c_2 -%}
{{ og_include('blocks/hero-head.html.j2', {'p': {'brand': og_get(v_nav, ['brand']), 'links': og_get(v_nav, ['links']), 'current': og_get(v_nav, ['current']), 'login': og_get(v_nav, ['login']), 'loginHref': og_get(v_nav, ['loginHref']), 'skip': og_get(v_nav, ['skip']), 'navLabel': og_get(v_nav, ['label']), 'cta': og_get(v_actions, ['cta']), 'href': og_get(v_actions, ['href']), 'landmarkLabel': v_landmarkLabel}}) }}
{%- set c_1 -%}
{%- if og_t(v_badge) %}
{{ og_include('blocks/hero-badge.html.j2', {'p': {'label': v_badge, 'mark': v_badgeMark}}) }}
{%- endif %}
{{ og_include('blocks/weighted-title.html.j2', {'p': {'id': 'home-hero-title', 'title': v_title, 'weights': og_preset('blocks/presets/defaults.json', ['hero', 'titleWeights']), 'level': v_level}}) }}
{%- if og_t(og_eq(og_get(v_actions, ['mode']), 'form')) %}
{{ og_include('blocks/prompt-composer.html.j2', {'p': {'label': og_get(v_actions, ['emailLabel']), 'attachLabel': og_get(v_composer, ['attachLabel']), 'modelLabel': og_get(v_composer, ['modelLabel']), 'send': og_get(v_actions, ['cta']), 'href': og_get(v_actions, ['href'])}}) }}
{%- elif og_t(og_get(v_actions, ['cta'])) %}
{{ og_include('blocks/action-group.html.j2', {'p': {'primary': og_get(v_actions, ['cta']), 'primaryHref': og_get(v_actions, ['href']), 'secondary': (og_get(v_actions, ['secondary']) if og_t(og_eq(og_get(v_actions, ['mode']), 'two')) else none), 'secondaryHref': og_get(v_actions, ['secondaryHref']), 'align': ('center' if og_t(true) else 'start')}}) }}
{%- endif %}
{%- if og_t(og_and([v_topics, og_gt(og_len(v_topics), 0)])) %}
{{ og_include('blocks/topic-chips.html.j2', {'p': {'topics': v_topics, 'tone': 'inverse'}}) }}
{%- endif %}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '0', 'Align': 'center', 'Class': og_s(og_cnv(['mx-auto w-full pt-24 pb-16', og_preset('blocks/presets/defaults.json', ['hero', 'column'])])), 'Attrs': og_attrs(['data-slot', 'hero-column'])}, 'children': c_1}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '0', 'Align': 'stretch'}, 'children': c_2}) }}
{%- endset -%}
{{ og_include('compose/container.html.j2', {'p': {'Class': og_s(og_cnv(['mx-auto w-full px-8', og_preset('blocks/presets/defaults.json', ['hero', 'container'])])), 'Attrs': og_attrs(['data-slot', 'container'])}, 'children': c_3}) }}
{%- endset -%}
{{ og_include('compose/block.html.j2', {'p': {'Tag': 'section', 'Class': og_s(og_cnv(['flex w-full flex-col bg-foreground text-background py-8 [&_.text-muted-foreground]:text-background/70', og_preset('blocks/presets/defaults.json', ['hero', 'band'])])), 'Attrs': og_attrs(['aria-labelledby', (none if og_t(v_landmarkLabel) else 'home-hero-title'), 'data-tone', 'inverse', 'data-density', v_density, 'data-chrome', 'nav', 'aria-label', v_landmarkLabel, 'data-slot', 'section'])}, 'children': c_4}) }}
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 dark hero band: the head row, a badge, a title with weighted words, the prompt box (or actions) and topic pills.
| Prop | Type | Default | Description |
|---|---|---|---|
| title (required) | string | - | |
| level | 1 | 2 | 1 | |
| badge | string | - | label of the badge (Meet Model V4.1) |
| badgeMark | string | - | small inner pill text (NEW) |
| actions | ActionSet | - | |
| composer | HeroComposer | - | labels of the prompt box |
| nav | HeroNav | - | the head row |
| topics | Topic[] | - | |
| density | "roomy" | "default" | "compact" | "roomy" | named on the section (data-density) like every section; the band keeps the frame's padding |
| 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 |