Post Feature
Post Feature component
Install
npx ui8kit add post-featurePulls in: badge, button, compose, group, kit-box, kit-button, kit-text, lucide-icon, media-frame, post-card, stack, text, title, utils
Preview
Why static-first pages still win
Less script, less waiting, and pages that keep working offline.
Mar 18, 2026 · 6 min read
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 post-feature<!-- 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 featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading
time, and a wide read button.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { Post, PostLabels } from "../blocks/post-card.types";
export type PostFeatureProps = {
p: Post;
labels: PostLabels;
};
</script>
<script lang="ts">
import Badge from "../compose/Badge.svelte";
import Button from "../compose/Button.svelte";
import Group from "../compose/Group.svelte";
import LucideIcon from "../icons/LucideIcon.svelte";
import Stack from "../compose/Stack.svelte";
import Text from "../compose/Text.svelte";
import Title from "../compose/Title.svelte";
import MediaFrame from "../components/media-frame.svelte";
import { tpl, urlOf } from "../utils";
let { p, labels }: PostFeatureProps = $props();
</script>
<Stack gap="4" align="stretch" class="border-t border-border pt-6" data-slot="post-feature">
<Badge variant="secondary" size="sm" class="w-fit">
{p.category}
</Badge>
<Title as={3} size="xl" weight="semibold">
{p.title}
</Title>
<Text size="sm" class="text-muted-foreground">
{p.excerpt}
</Text>
<Group gap="4" align="center">
<MediaFrame alt={p.author} ratio="1/1" class="size-10 shrink-0 rounded-full" />
<Stack gap="0">
<Text size="sm" weight="semibold">
{p.author}
</Text>
<Text size="xs" class="text-muted-foreground">
{tpl("{0} · {1}", p.date, tpl(labels.minutes, p.minutes))}
</Text>
</Stack>
</Group>
<Button variant="default" size="default" href={urlOf(p.href)} class="w-full gap-2">
{labels.read}
<LucideIcon name="arrow-right" size={16} />
</Button>
</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 post-feature// 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 featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading
* time, and a wide read button.
*/
import { type ReactNode } from "react";
import { Badge, Button, Group, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { tpl, urlOf } from "../utils";
import type { Post, PostLabels } from "../blocks/post-card.types";
export type PostFeatureProps = {
p: Post;
labels: PostLabels;
};
export function PostFeature({ p, labels }: PostFeatureProps) {
return (
<Stack gap="4" align="stretch" className="border-t border-border pt-6" data-slot="post-feature">
<Badge variant="secondary" size="sm" className="w-fit">
{p.category}
</Badge>
<Title as={3} size="xl" weight="semibold">
{p.title}
</Title>
<Text size="sm" className="text-muted-foreground">
{p.excerpt}
</Text>
<Group gap="4" align="center">
<MediaFrame alt={p.author} ratio="1/1" className="size-10 shrink-0 rounded-full" />
<Stack gap="0">
<Text size="sm" weight="semibold">
{p.author}
</Text>
<Text size="xs" className="text-muted-foreground">
{tpl("{0} · {1}", p.date, tpl(labels.minutes, p.minutes))}
</Text>
</Stack>
</Group>
<Button variant="default" size="default" href={urlOf(p.href)} className="w-full gap-2">
{labels.read}
<LucideIcon name="arrow-right" size={16} />
</Button>
</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 post-feature<!-- 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 featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading
time, and a wide read button.
-->
<script lang="ts">
import type { Post, PostLabels } from "../blocks/post-card.types";
export type PostFeatureProps = {
p: Post;
labels: PostLabels;
};
</script>
<script setup lang="ts">
import Badge from "../compose/Badge.vue";
import Button from "../compose/Button.vue";
import Group from "../compose/Group.vue";
import LucideIcon from "../icons/LucideIcon.vue";
import Stack from "../compose/Stack.vue";
import Text from "../compose/Text.vue";
import Title from "../compose/Title.vue";
import MediaFrame from "../components/media-frame.vue";
import { tpl, urlOf } from "../utils";
const { p, labels } = defineProps<PostFeatureProps>();
</script>
<template>
<Stack gap="4" align="stretch" class="border-t border-border pt-6" data-slot="post-feature">
<Badge variant="secondary" size="sm" class="w-fit">
{{ p.category }}
</Badge>
<Title :as="3" size="xl" weight="semibold">
{{ p.title }}
</Title>
<Text size="sm" class="text-muted-foreground">
{{ p.excerpt }}
</Text>
<Group gap="4" align="center">
<MediaFrame :alt="p.author" ratio="1/1" class="size-10 shrink-0 rounded-full" />
<Stack gap="0">
<Text size="sm" weight="semibold">
{{ p.author }}
</Text>
<Text size="xs" class="text-muted-foreground">
{{ tpl("{0} · {1}", p.date, tpl(labels.minutes, p.minutes)) }}
</Text>
</Stack>
</Group>
<Button variant="default" size="default" :href="urlOf(p.href)" class="w-full gap-2">
{{ labels.read }}
<LucideIcon name="arrow-right" :size="16" />
</Button>
</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 post-feature// 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 featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading
* time, and a wide read button.
*/
import { type JSX } from "solid-js";
import { Badge, Button, Group, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { tpl, urlOf } from "../utils";
import type { Post, PostLabels } from "../blocks/post-card.types";
export type PostFeatureProps = {
p: Post;
labels: PostLabels;
};
export function PostFeature({ p, labels }: PostFeatureProps) {
return (
<Stack gap="4" align="stretch" class="border-t border-border pt-6" data-slot="post-feature">
<Badge variant="secondary" size="sm" class="w-fit">
{p.category}
</Badge>
<Title as={3} size="xl" weight="semibold">
{p.title}
</Title>
<Text size="sm" class="text-muted-foreground">
{p.excerpt}
</Text>
<Group gap="4" align="center">
<MediaFrame alt={p.author} ratio="1/1" class="size-10 shrink-0 rounded-full" />
<Stack gap="0">
<Text size="sm" weight="semibold">
{p.author}
</Text>
<Text size="xs" class="text-muted-foreground">
{tpl("{0} · {1}", p.date, tpl(labels.minutes, p.minutes))}
</Text>
</Stack>
</Group>
<Button variant="default" size="default" href={urlOf(p.href)} class="w-full gap-2">
{labels.read}
<LucideIcon name="arrow-right" size={16} />
</Button>
</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 post-feature// 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/post-feature.json
package blocks
import (
"github.com/ui8kit/codegen/generated/templ/ui/box"
"github.com/ui8kit/codegen/generated/templ/ui/button"
"github.com/ui8kit/codegen/generated/templ/compose"
"github.com/ui8kit/codegen/generated/templ/icons"
"github.com/ui8kit/codegen/generated/templ/ui/text"
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// PostFeatureProps are the props of PostFeature; the values are the JSON shapes of the TypeScript props.
type PostFeatureProps struct {
P any `json:"p"`
Labels any `json:"labels"`
}
// The featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading time, and a wide read button.
templ PostFeature(p PostFeatureProps) {
{{ vP := p.P }}
{{ vLabels := p.Labels }}
@compose.Stack(compose.StackProps{Gap: "4", Align: "stretch", BoxProps: box.BoxProps{Class: "border-t border-border pt-6", Attrs: uiutils.Attrs("data-slot", "post-feature")}}) {
@compose.Badge(compose.BadgeProps{Variant: "secondary", Size: "sm", TextProps: text.TextProps{Class: "w-fit"}}) {
{ uiutils.Text(uiutils.Get(vP, "category")) }
}
@compose.Title(compose.TitleProps{As: "3", Size: "xl", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vP, "title")) }
}
@compose.Text(compose.TextProps{Size: "sm", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Get(vP, "excerpt")) }
}
@compose.Group(compose.GroupProps{Gap: "4", Align: "center", BoxProps: box.BoxProps{}}) {
@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vP, "author"), Ratio: "1/1", Class: uiutils.Cnv("size-10 shrink-0 rounded-full")})
@compose.Stack(compose.StackProps{Gap: "0", BoxProps: box.BoxProps{}}) {
@compose.Text(compose.TextProps{Size: "sm", Weight: "semibold", TextProps: text.TextProps{}}) {
{ uiutils.Text(uiutils.Get(vP, "author")) }
}
@compose.Text(compose.TextProps{Size: "xs", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
{ uiutils.Text(uiutils.Tpl("{0} · {1}", uiutils.Get(vP, "date"), uiutils.Tpl(uiutils.Get(vLabels, "minutes"), uiutils.Get(vP, "minutes")))) }
}
}
}
@compose.Button(compose.ButtonProps{Variant: "default", Size: "default", ButtonProps: button.ButtonProps{Href: uiutils.URL(uiutils.Get(vP, "href"), false), Class: "w-full gap-2"}}) {
{ uiutils.Text(uiutils.Get(vLabels, "read")) }
@icons.LucideIcon(icons.LucideIconProps{Name: "arrow-right", Size: 16})
}
}
}
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 post-feature{#- 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/post-feature.json
The featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading time, and a wide read button.
Props (p): p, labels. -#}
{%- set v_p = (p.p ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set c_9 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_p, ['category'])) }}
{%- endset -%}
{{ include('compose/Badge.html.twig', {'variant': 'secondary', 'size': 'sm', 'class': 'w-fit', 'children': c_1}, with_context = false) }}
{%- set c_2 -%}
{{ og_text(og_get(v_p, ['title'])) }}
{%- endset -%}
{{ include('compose/Title.html.twig', {'as': 3, 'size': 'xl', 'weight': 'semibold', 'children': c_2}, with_context = false) }}
{%- set c_3 -%}
{{ og_text(og_get(v_p, ['excerpt'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'class': 'text-muted-foreground', 'children': c_3}, with_context = false) }}
{%- set c_7 -%}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_p, ['author']), 'ratio': '1/1', 'className': og_cnv(['size-10 shrink-0 rounded-full'])}}, with_context = false) }}
{%- set c_6 -%}
{%- set c_4 -%}
{{ og_text(og_get(v_p, ['author'])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'sm', 'weight': 'semibold', 'children': c_4}, with_context = false) }}
{%- set c_5 -%}
{{ og_text(og_tpl('{0} · {1}', [og_get(v_p, ['date']), og_tpl(og_get(v_labels, ['minutes']), [og_get(v_p, ['minutes'])])])) }}
{%- endset -%}
{{ include('compose/Text.html.twig', {'size': 'xs', 'class': 'text-muted-foreground', 'children': c_5}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '0', 'children': c_6}, with_context = false) }}
{%- endset -%}
{{ include('compose/Group.html.twig', {'gap': '4', 'align': 'center', 'children': c_7}, with_context = false) }}
{%- set c_8 -%}
{{ og_text(og_get(v_labels, ['read'])) }}
{{ include('icons/LucideIcon.html.twig', {'name': 'arrow-right', 'size': 16}, with_context = false) }}
{%- endset -%}
{{ include('compose/Button.html.twig', {'variant': 'default', 'size': 'default', 'href': og_url(og_s(og_get(v_p, ['href']))), 'class': 'w-full gap-2', 'children': c_8}, with_context = false) }}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '4', 'align': 'stretch', 'class': 'border-t border-border pt-6', 'attrs': og_attrs(['data-slot', 'post-feature']), 'children': c_9}, 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 post-feature{* 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/post-feature.json
The featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading time, and a wide read button.
Props (p): p, labels. *}
{var $v_p = ($p['p'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{capture $c_9}
{capture $c_1}
{=og_text(og_get($v_p, ['category']))}
{/capture}
{=og_include('compose/Badge.latte', ['variant' => 'secondary', 'size' => 'sm', 'class' => 'w-fit', 'children' => (string) $c_1])|noescape}
{capture $c_2}
{=og_text(og_get($v_p, ['title']))}
{/capture}
{=og_include('compose/Title.latte', ['as' => 3, 'size' => 'xl', 'weight' => 'semibold', 'children' => (string) $c_2])|noescape}
{capture $c_3}
{=og_text(og_get($v_p, ['excerpt']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'class' => 'text-muted-foreground', 'children' => (string) $c_3])|noescape}
{capture $c_7}
{=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_p, ['author']), 'ratio' => '1/1', 'className' => og_cnv(['size-10 shrink-0 rounded-full'])]])|noescape}
{capture $c_6}
{capture $c_4}
{=og_text(og_get($v_p, ['author']))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'sm', 'weight' => 'semibold', 'children' => (string) $c_4])|noescape}
{capture $c_5}
{=og_text(og_tpl('{0} · {1}', [og_get($v_p, ['date']), og_tpl(og_get($v_labels, ['minutes']), [og_get($v_p, ['minutes'])])]))}
{/capture}
{=og_include('compose/Text.latte', ['size' => 'xs', 'class' => 'text-muted-foreground', 'children' => (string) $c_5])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '0', 'children' => (string) $c_6])|noescape}
{/capture}
{=og_include('compose/Group.latte', ['gap' => '4', 'align' => 'center', 'children' => (string) $c_7])|noescape}
{capture $c_8}
{=og_text(og_get($v_labels, ['read']))}
{=og_include('icons/LucideIcon.latte', ['name' => 'arrow-right', 'size' => 16])|noescape}
{/capture}
{=og_include('compose/Button.latte', ['variant' => 'default', 'size' => 'default', 'href' => og_url(og_s(og_get($v_p, ['href']))), 'class' => 'w-full gap-2', 'children' => (string) $c_8])|noescape}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '4', 'align' => 'stretch', 'class' => 'border-t border-border pt-6', 'attrs' => og_attrs(['data-slot', 'post-feature']), 'children' => (string) $c_9])|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 post-feature{#- 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/post-feature.json
The featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading time, and a wide read button.
Props (p): p, labels. -#}
{%- set v_p = og_def(p['p'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set c_9 -%}
{%- set c_1 -%}
{{ og_text(og_get(v_p, ['category'])) }}
{%- endset -%}
{{ og_include('compose/badge.html.j2', {'p': {'Variant': 'secondary', 'Size': 'sm', 'Class': 'w-fit'}, 'children': c_1}) }}
{%- set c_2 -%}
{{ og_text(og_get(v_p, ['title'])) }}
{%- endset -%}
{{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'xl', 'Weight': 'semibold'}, 'children': c_2}) }}
{%- set c_3 -%}
{{ og_text(og_get(v_p, ['excerpt'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Class': 'text-muted-foreground'}, 'children': c_3}) }}
{%- set c_7 -%}
{{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_p, ['author']), 'ratio': '1/1', 'className': og_cnv(['size-10 shrink-0 rounded-full'])}}) }}
{%- set c_6 -%}
{%- set c_4 -%}
{{ og_text(og_get(v_p, ['author'])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'sm', 'Weight': 'semibold'}, 'children': c_4}) }}
{%- set c_5 -%}
{{ og_text(og_tpl('{0} · {1}', [og_get(v_p, ['date']), og_tpl(og_get(v_labels, ['minutes']), [og_get(v_p, ['minutes'])])])) }}
{%- endset -%}
{{ og_include('compose/text.html.j2', {'p': {'Size': 'xs', 'Class': 'text-muted-foreground'}, 'children': c_5}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '0'}, 'children': c_6}) }}
{%- endset -%}
{{ og_include('compose/group.html.j2', {'p': {'Gap': '4', 'Align': 'center'}, 'children': c_7}) }}
{%- set c_8 -%}
{{ og_text(og_get(v_labels, ['read'])) }}
{{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': 'arrow-right', 'Size': 16}}) }}
{%- endset -%}
{{ og_include('compose/button.html.j2', {'p': {'Variant': 'default', 'Size': 'default', 'Href': og_url(og_s(og_get(v_p, ['href']))), 'Class': 'w-full gap-2'}, 'children': c_8}) }}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '4', 'Align': 'stretch', 'Class': 'border-t border-border pt-6', 'Attrs': og_attrs(['data-slot', 'post-feature'])}, 'children': c_9}) }}
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 featured post of PostShowcase: the category, the title, the excerpt, the author with the date and reading time, and a wide read button.
| Prop | Type | Default | Description |
|---|---|---|---|
| p (required) | Post | - | |
| labels (required) | PostLabels | - | templates: minutes `{0} min read`, by `By {0}`; and the word of the read link |