Skip to content
ui8kit

component / components

Feature Rows

Feature Rows component

Install

npx ui8kit add feature-rows

Pulls in: box, compose, feature-grid, grid, kit-box, kit-text, lucide-icon, media-frame, stack, text, title, utils

Preview

Fast by default

Pages render from static data and ship little script.

Clear structure

One heading per page, landmarks and a skip link come built in.

Safe forms

Inputs carry labels and errors are announced to assistive tools.

Ready for any language

Every text lives in a dictionary, so a new language is one more file.

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-cdn
npx ui8kit add feature-rows
components/feature-rows.svelte
<!-- 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 features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names. -->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Feature } from "../blocks/feature-grid.types";

  export type FeatureRowsProps = {
    features: Feature[];
    mediaSide?: "end" | "start" | "alternate";
  };
</script>

<script lang="ts">
  import Box from "../compose/Box.svelte";
  import Grid from "../compose/Grid.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 { cn } from "../utils";

  let { features, mediaSide = "end" }: FeatureRowsProps = $props();
</script>

<Stack gap="8" align="stretch" data-slot="feature-rows">
  {#each features as feature (feature.id)}
    <Grid cols="1-2" class="group items-center gap-8" data-slot="feature-card">
      <Stack gap="2" class="min-w-0">
        <LucideIcon name={feature.icon} size={24} />
        <Title as={3} size="xl" weight="bold">
          {feature.title}
        </Title>
        <Text size="base" class="text-muted-foreground">
          {feature.text}
        </Text>
      </Stack>
      <Box
        class={cn(
          "w-full min-w-0",
          (
            (mediaSide as string) === "start" ? "md:order-first"
            : (mediaSide as string) === "alternate" ? "md:group-even:order-first"
            : ""
          )
        )}
      >
        <MediaFrame alt={feature.title} src={feature.image} ratio="4/3" />
      </Box>
    </Grid>
  {/each}
</Stack>

Svelte registry item (JSON)

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-cdn
npx ui8kit add feature-rows
components/feature-rows.tsx
// 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 features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names. */
import { type ReactNode } from "react";
import { Box, Grid, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { cn } from "../utils";
import type { Feature } from "../blocks/feature-grid.types";

export type FeatureRowsProps = {
  features: Feature[];
  mediaSide?: "end" | "start" | "alternate";
};

export function FeatureRows({ features, mediaSide = "end" }: FeatureRowsProps) {
  return (
    <Stack gap="8" align="stretch" data-slot="feature-rows">
      {(features ?? []).map((feature) => (
        <Grid key={feature.id} cols="1-2" className="group items-center gap-8" data-slot="feature-card">
          <Stack gap="2" className="min-w-0">
            <LucideIcon name={feature.icon} size={24} />
            <Title as={3} size="xl" weight="bold">
              {feature.title}
            </Title>
            <Text size="base" className="text-muted-foreground">
              {feature.text}
            </Text>
          </Stack>
          <Box
            className={cn(
              "w-full min-w-0",
              (
                (mediaSide as string) === "start" ? "md:order-first"
                : (mediaSide as string) === "alternate" ? "md:group-even:order-first"
                : ""
              )
            )}
          >
            <MediaFrame alt={feature.title} src={feature.image} ratio="4/3" />
          </Box>
        </Grid>
      ))}
    </Stack>
  );
}

React registry item (JSON)

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-cdn
npx ui8kit add feature-rows
components/feature-rows.vue
<!-- 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 features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names. -->
<script lang="ts">
import type { Feature } from "../blocks/feature-grid.types";

export type FeatureRowsProps = {
  features: Feature[];
  mediaSide?: "end" | "start" | "alternate";
};
</script>

<script setup lang="ts">
import Box from "../compose/Box.vue";
import Grid from "../compose/Grid.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 { cn } from "../utils";

const { features, mediaSide = "end" } = defineProps<FeatureRowsProps>();
</script>

<template>
  <Stack gap="8" align="stretch" data-slot="feature-rows">
    <Grid
      v-for="feature in features"
      :key="feature.id"
      cols="1-2"
      class="group items-center gap-8"
      data-slot="feature-card"
    >
      <Stack gap="2" class="min-w-0">
        <LucideIcon :name="feature.icon" :size="24" />
        <Title :as="3" size="xl" weight="bold">
          {{ feature.title }}
        </Title>
        <Text size="base" class="text-muted-foreground">
          {{ feature.text }}
        </Text>
      </Stack>
      <Box
        :class="cn(
          'w-full min-w-0',
          (
            (mediaSide as string) === 'start' ? 'md:order-first'
            : (mediaSide as string) === 'alternate' ? 'md:group-even:order-first'
            : ''
          )
        )"
      >
        <MediaFrame :alt="feature.title" :src="feature.image" ratio="4/3" />
      </Box>
    </Grid>
  </Stack>
</template>

Vue registry item (JSON)

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-cdn
npx ui8kit add feature-rows
components/feature-rows.tsx
// 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 features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names. */
import { For, type JSX } from "solid-js";
import { Box, Grid, Stack, Text, Title } from "../compose";
import { LucideIcon } from "../icons/LucideIcon";
import { MediaFrame } from "../components/media-frame";
import { cn } from "../utils";
import type { Feature } from "../blocks/feature-grid.types";

export type FeatureRowsProps = {
  features: Feature[];
  mediaSide?: "end" | "start" | "alternate";
};

export function FeatureRows({ features, mediaSide = "end" }: FeatureRowsProps) {
  return (
    <Stack gap="8" align="stretch" data-slot="feature-rows">
      <For each={features ?? []}>{(feature) => (
        <Grid cols="1-2" class="group items-center gap-8" data-slot="feature-card">
          <Stack gap="2" class="min-w-0">
            <LucideIcon name={feature.icon} size={24} />
            <Title as={3} size="xl" weight="bold">
              {feature.title}
            </Title>
            <Text size="base" class="text-muted-foreground">
              {feature.text}
            </Text>
          </Stack>
          <Box
            class={cn(
              "w-full min-w-0",
              (
                (mediaSide as string) === "start" ? "md:order-first"
                : (mediaSide as string) === "alternate" ? "md:group-even:order-first"
                : ""
              )
            )}
          >
            <MediaFrame alt={feature.title} src={feature.image} ratio="4/3" />
          </Box>
        </Grid>
      )}</For>
    </Stack>
  );
}

Solid registry item (JSON)

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-cdn
npx ui8kit add feature-rows
blocks/feature-rows.templ
// 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/feature-rows.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/icons"
	"github.com/ui8kit/codegen/generated/templ/ui/text"
	uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)

// FeatureRowsProps are the props of FeatureRows; the values are the JSON shapes of the TypeScript props.
type FeatureRowsProps struct {
	Features any `json:"features"`
	MediaSide any `json:"mediaSide"`
}

// The features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names.
templ FeatureRows(p FeatureRowsProps) {
	{{ vFeatures := p.Features }}
	{{ vMediaSide := uiutils.Def(p.MediaSide, "end") }}
	@compose.Stack(compose.StackProps{Gap: "8", Align: "stretch", BoxProps: box.BoxProps{Attrs: uiutils.Attrs("data-slot", "feature-rows")}}) {
		for _, vFeature := range uiutils.L(vFeatures) {
			@compose.Grid(compose.GridProps{Cols: "1-2", BoxProps: box.BoxProps{Class: "group items-center gap-8", Attrs: uiutils.Attrs("data-slot", "feature-card")}}) {
				@compose.Stack(compose.StackProps{Gap: "2", BoxProps: box.BoxProps{Class: "min-w-0"}}) {
					@icons.LucideIcon(icons.LucideIconProps{Name: uiutils.S(uiutils.Get(vFeature, "icon")), Size: 24})
					@compose.Title(compose.TitleProps{As: "3", Size: "xl", Weight: "bold", TextProps: text.TextProps{}}) {
						{ uiutils.Text(uiutils.Get(vFeature, "title")) }
					}
					@compose.Text(compose.TextProps{Size: "base", TextProps: text.TextProps{Class: "text-muted-foreground"}}) {
						{ uiutils.Text(uiutils.Get(vFeature, "text")) }
					}
				}
				@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(uiutils.Cnv("w-full min-w-0", uiutils.Cond(uiutils.T(uiutils.Eq(vMediaSide, "start")), "md:order-first", uiutils.Cond(uiutils.T(uiutils.Eq(vMediaSide, "alternate")), "md:group-even:order-first", ""))))}}) {
					@MediaFrame(MediaFrameProps{Alt: uiutils.Get(vFeature, "title"), Src: uiutils.Get(vFeature, "image"), Ratio: "4/3"})
				}
			}
		}
	}
}

templ registry item (JSON)

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-cdn
npx ui8kit add feature-rows
blocks/feature-rows.html.twig
{#- 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/feature-rows.json
    The features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names.
    Props (p): features, mediaSide. -#}
{%- set v_features = (p.features ?? null) -%}
{%- set v_mediaSide = (p.mediaSide ?? 'end') -%}
{%- set c_6 -%}
  {%- for v_feature in og_l(v_features) %}
    {%- set c_5 -%}
      {%- set c_3 -%}
        {{ include('icons/LucideIcon.html.twig', {'name': og_s(og_get(v_feature, ['icon'])), 'size': 24}, with_context = false) }}
        {%- set c_1 -%}
          {{ og_text(og_get(v_feature, ['title'])) }}
        {%- endset -%}
        {{ include('compose/Title.html.twig', {'as': 3, 'size': 'xl', 'weight': 'bold', 'children': c_1}, with_context = false) }}
        {%- set c_2 -%}
          {{ og_text(og_get(v_feature, ['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) }}
      {%- set c_4 -%}
        {{ include('blocks/media-frame.html.twig', {'p': {'alt': og_get(v_feature, ['title']), 'src': og_get(v_feature, ['image']), 'ratio': '4/3'}}, with_context = false) }}
      {%- endset -%}
      {{ include('compose/Box.html.twig', {'class': og_s(og_cnv(['w-full min-w-0', (og_t(og_eq(v_mediaSide, 'start')) ? 'md:order-first' : (og_t(og_eq(v_mediaSide, 'alternate')) ? 'md:group-even:order-first' : ''))])), 'children': c_4}, with_context = false) }}
    {%- endset -%}
    {{ include('compose/Grid.html.twig', {'cols': '1-2', 'class': 'group items-center gap-8', 'attrs': og_attrs(['data-slot', 'feature-card']), 'children': c_5}, with_context = false) }}
  {%- endfor %}
{%- endset -%}
{{ include('compose/Stack.html.twig', {'gap': '8', 'align': 'stretch', 'attrs': og_attrs(['data-slot', 'feature-rows']), 'children': c_6}, with_context = false) }}

Twig registry item (JSON)

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-cdn
npx ui8kit add feature-rows
blocks/feature-rows.latte
{* 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/feature-rows.json
    The features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names.
    Props (p): features, mediaSide. *}
{var $v_features = ($p['features'] ?? null)}
{var $v_mediaSide = ($p['mediaSide'] ?? 'end')}
{capture $c_6}
  {foreach og_l($v_features) as $v_feature}
    {capture $c_5}
      {capture $c_3}
        {=og_include('icons/LucideIcon.latte', ['name' => og_s(og_get($v_feature, ['icon'])), 'size' => 24])|noescape}
        {capture $c_1}
          {=og_text(og_get($v_feature, ['title']))}
        {/capture}
        {=og_include('compose/Title.latte', ['as' => 3, 'size' => 'xl', 'weight' => 'bold', 'children' => (string) $c_1])|noescape}
        {capture $c_2}
          {=og_text(og_get($v_feature, ['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}
      {capture $c_4}
        {=og_include('blocks/media-frame.latte', ['p' => ['alt' => og_get($v_feature, ['title']), 'src' => og_get($v_feature, ['image']), 'ratio' => '4/3']])|noescape}
      {/capture}
      {=og_include('compose/Box.latte', ['class' => og_s(og_cnv(['w-full min-w-0', (og_t(og_eq($v_mediaSide, 'start')) ? 'md:order-first' : (og_t(og_eq($v_mediaSide, 'alternate')) ? 'md:group-even:order-first' : ''))])), 'children' => (string) $c_4])|noescape}
    {/capture}
    {=og_include('compose/Grid.latte', ['cols' => '1-2', 'class' => 'group items-center gap-8', 'attrs' => og_attrs(['data-slot', 'feature-card']), 'children' => (string) $c_5])|noescape}
  {/foreach}
{/capture}
{=og_include('compose/Stack.latte', ['gap' => '8', 'align' => 'stretch', 'attrs' => og_attrs(['data-slot', 'feature-rows']), 'children' => (string) $c_6])|noescape}

Latte registry item (JSON)

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-cdn
npx ui8kit add feature-rows
blocks/feature-rows.html.j2
{#- 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/feature-rows.json
    The features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names.
    Props (p): features, mediaSide. -#}
{%- set v_features = og_def(p['features'], none) -%}
{%- set v_mediaSide = og_def(p['mediaSide'], 'end') -%}
{%- set c_6 -%}
  {%- for v_feature in og_l(v_features) %}
    {%- set c_5 -%}
      {%- set c_3 -%}
        {{ og_include('icons/lucide-icon.html.j2', {'p': {'Name': og_s(og_get(v_feature, ['icon'])), 'Size': 24}}) }}
        {%- set c_1 -%}
          {{ og_text(og_get(v_feature, ['title'])) }}
        {%- endset -%}
        {{ og_include('compose/title.html.j2', {'p': {'As': 3, 'Size': 'xl', 'Weight': 'bold'}, 'children': c_1}) }}
        {%- set c_2 -%}
          {{ og_text(og_get(v_feature, ['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}) }}
      {%- set c_4 -%}
        {{ og_include('blocks/media-frame.html.j2', {'p': {'alt': og_get(v_feature, ['title']), 'src': og_get(v_feature, ['image']), 'ratio': '4/3'}}) }}
      {%- endset -%}
      {{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_cnv(['w-full min-w-0', ('md:order-first' if og_t(og_eq(v_mediaSide, 'start')) else ('md:group-even:order-first' if og_t(og_eq(v_mediaSide, 'alternate')) else ''))]))}, 'children': c_4}) }}
    {%- endset -%}
    {{ og_include('compose/grid.html.j2', {'p': {'Cols': '1-2', 'Class': 'group items-center gap-8', 'Attrs': og_attrs(['data-slot', 'feature-card'])}, 'children': c_5}) }}
  {%- endfor %}
{%- endset -%}
{{ og_include('compose/stack.html.j2', {'p': {'Gap': '8', 'Align': 'stretch', 'Attrs': og_attrs(['data-slot', 'feature-rows'])}, 'children': c_6}) }}

Jinja2 registry item (JSON)

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 features as rows: text beside a picture (the rows layout of FeatureGrid). Icons are Lucide names.

Props of FeatureRows
PropTypeDefault Description
features (required)Feature[]-
mediaSide "end" | "start" | "alternate""end"side of the picture; alternate swaps it every row

Used in