Media List
Four figures, figures with a featured review, numbered steps, the latest posts, topic rows, or contact buttons with support figures, beside a picture.
Install
npx ui8kit add media-listPulls in: action-group, category-nav, error-page, feature-grid, media-contacts, media-figures, media-frame, media-posts, media-review, media-steps, media-topics, post-card, review-list, section-frame, stats-band, steps-list, utils
Preview
Results you can measure
Teams of every size publish faster and keep their pages fast.
12,400
Sites published
99.99%
Uptime
3,200
Teams
0.8s
Median load
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 media-list<!-- 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 list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures
and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts,
contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
-->
<script lang="ts" module>
import type { Snippet } from "svelte";
import type { MediaExtras, MediaListLabels } from "./media-list.types";
import type { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
import type { LinkActions } from "./error-page.types";
export type MediaListProps = {
id: string;
title: string;
lead?: string;
badge?: string;
extras: MediaExtras;
labels: MediaListLabels;
actions: LinkActions;
layout?: "figures" | "proof" | "steps" | "posts" | "topics" | "contact";
mediaSide?: "end" | "start";
tone?: "default" | "muted";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
</script>
<script lang="ts">
import ActionGroup from "../components/action-group.svelte";
import MediaContacts from "../components/media-contacts.svelte";
import MediaFigures from "../components/media-figures.svelte";
import MediaFrame from "../components/media-frame.svelte";
import MediaPosts from "../components/media-posts.svelte";
import MediaReview from "../components/media-review.svelte";
import MediaSteps from "../components/media-steps.svelte";
import MediaTopics from "../components/media-topics.svelte";
import SectionFrame from "../components/section-frame.svelte";
let {
id,
title,
lead = "",
badge = "",
extras,
labels,
actions,
layout = "figures",
mediaSide = "end",
tone = "default",
image,
imageAlt,
landmarkLabel,
}: MediaListProps = $props();
</script>
<SectionFrame
id={id}
title={title}
lead={lead}
heading={{ badge }}
tone={tone}
layout="split"
media={{ show: true, side: mediaSide }}
landmarkLabel={landmarkLabel}
>
{#if (((layout as string) === "figures") || ((layout as string) === "proof"))}
{#if ((extras.stats?.length ?? 0) > 0)}
<MediaFigures extras={extras} mode={(((layout as string) === "proof") ? "row" : "grid")} />
{/if}
{/if}
{#if ((layout as string) === "proof")}
{#if ((extras.reviews?.length ?? 0) > 0)}
<MediaReview extras={extras} labels={labels} />
{/if}
{/if}
{#if ((layout as string) === "steps")}
{#if ((extras.steps?.length ?? 0) > 0)}
<MediaSteps extras={extras} labels={labels} />
{/if}
{/if}
{#if ((layout as string) === "posts")}
{#if ((extras.posts?.length ?? 0) > 0)}
<MediaPosts extras={extras} labels={labels} />
{/if}
{/if}
{#if ((layout as string) === "topics")}
{#if ((extras.topics?.length ?? 0) > 0)}
<MediaTopics extras={extras} labels={labels} />
{/if}
{/if}
{#if ((layout as string) === "contact")}
{#if ((extras.channels?.length ?? 0) > 0)}
<MediaContacts extras={extras} labels={labels} />
{/if}
{/if}
{#if ((layout as string) !== "contact")}
<ActionGroup
primary={actions.cta}
primaryHref={actions.href}
secondary={((actions.mode === "two") ? actions.secondary : undefined)}
secondaryHref={actions.secondaryHref}
/>
{/if}
{#snippet aside()}
<MediaFrame
alt={(imageAlt ? imageAlt : title)}
src={image}
ratio={((((layout as string) === "steps") || ((layout as string) === "topics")) ? "1/1" : "4/3")}
/>
{/snippet}
</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.
import type { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
export type MediaExtras = {
stats: Stat[];
steps: Step[];
posts: Post[];
topics: Category[];
channels: Feature[];
reviews: Review[];
};
export type MediaListLabels = {
list: string;
count: string;
minutes: string;
featured: string;
rating: string;
figures: 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 media-list// 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 list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures
* and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts,
* contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
*/
import { type ReactNode } from "react";
import { ActionGroup } from "../components/action-group";
import { MediaContacts } from "../components/media-contacts";
import { MediaFigures } from "../components/media-figures";
import { MediaFrame } from "../components/media-frame";
import { MediaPosts } from "../components/media-posts";
import { MediaReview } from "../components/media-review";
import { MediaSteps } from "../components/media-steps";
import { MediaTopics } from "../components/media-topics";
import { SectionFrame } from "../components/section-frame";
import type { MediaExtras, MediaListLabels } from "./media-list.types";
import type { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
import type { LinkActions } from "./error-page.types";
export type MediaListProps = {
id: string;
title: string;
lead?: string;
badge?: string;
extras: MediaExtras;
labels: MediaListLabels;
actions: LinkActions;
layout?: "figures" | "proof" | "steps" | "posts" | "topics" | "contact";
mediaSide?: "end" | "start";
tone?: "default" | "muted";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
export function MediaList({
id,
title,
lead = "",
badge = "",
extras,
labels,
actions,
layout = "figures",
mediaSide = "end",
tone = "default",
image,
imageAlt,
landmarkLabel,
}: MediaListProps) {
return (
<SectionFrame
id={id}
title={title}
lead={lead}
heading={{ badge }}
tone={tone}
layout="split"
media={{ show: true, side: mediaSide }}
landmarkLabel={landmarkLabel}
aside={(
<MediaFrame
alt={(imageAlt ? imageAlt : title)}
src={image}
ratio={((((layout as string) === "steps") || ((layout as string) === "topics")) ? "1/1" : "4/3")}
/>
)}
>
{(((layout as string) === "figures") || ((layout as string) === "proof")) ? (
<>
{((extras.stats?.length ?? 0) > 0) ? (
<MediaFigures extras={extras} mode={(((layout as string) === "proof") ? "row" : "grid")} />
) : null}
</>
) : null}
{((layout as string) === "proof") ? (
<>
{((extras.reviews?.length ?? 0) > 0) ? (
<MediaReview extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "steps") ? (
<>
{((extras.steps?.length ?? 0) > 0) ? (
<MediaSteps extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "posts") ? (
<>
{((extras.posts?.length ?? 0) > 0) ? (
<MediaPosts extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "topics") ? (
<>
{((extras.topics?.length ?? 0) > 0) ? (
<MediaTopics extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "contact") ? (
<>
{((extras.channels?.length ?? 0) > 0) ? (
<MediaContacts extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) !== "contact") ? (
<ActionGroup
primary={actions.cta}
primaryHref={actions.href}
secondary={((actions.mode === "two") ? actions.secondary : undefined)}
secondaryHref={actions.secondaryHref}
/>
) : null}
</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.
import type { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
export type MediaExtras = {
stats: Stat[];
steps: Step[];
posts: Post[];
topics: Category[];
channels: Feature[];
reviews: Review[];
};
export type MediaListLabels = {
list: string;
count: string;
minutes: string;
featured: string;
rating: string;
figures: 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 media-list// 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 { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
export type MediaExtras = {
stats: Stat[];
steps: Step[];
posts: Post[];
topics: Category[];
channels: Feature[];
reviews: Review[];
};
export type MediaListLabels = {
list: string;
count: string;
minutes: string;
featured: string;
rating: string;
figures: 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 list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures
and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts,
contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
-->
<script lang="ts">
import type { MediaExtras, MediaListLabels } from "./media-list.types";
import type { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
import type { LinkActions } from "./error-page.types";
export type MediaListProps = {
id: string;
title: string;
lead?: string;
badge?: string;
extras: MediaExtras;
labels: MediaListLabels;
actions: LinkActions;
layout?: "figures" | "proof" | "steps" | "posts" | "topics" | "contact";
mediaSide?: "end" | "start";
tone?: "default" | "muted";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
</script>
<script setup lang="ts">
import ActionGroup from "../components/action-group.vue";
import MediaContacts from "../components/media-contacts.vue";
import MediaFigures from "../components/media-figures.vue";
import MediaFrame from "../components/media-frame.vue";
import MediaPosts from "../components/media-posts.vue";
import MediaReview from "../components/media-review.vue";
import MediaSteps from "../components/media-steps.vue";
import MediaTopics from "../components/media-topics.vue";
import SectionFrame from "../components/section-frame.vue";
const {
id,
title,
lead = "",
badge = "",
extras,
labels,
actions,
layout = "figures",
mediaSide = "end",
tone = "default",
image,
imageAlt,
landmarkLabel,
} = defineProps<MediaListProps>();
</script>
<template>
<SectionFrame
:id="id"
:title="title"
:lead="lead"
:heading="{ badge }"
:tone="tone"
layout="split"
:media="{ show: true, side: mediaSide }"
:landmarkLabel="landmarkLabel"
>
<template v-if="(((layout as string) === 'figures') || ((layout as string) === 'proof'))">
<MediaFigures
v-if="((extras.stats?.length ?? 0) > 0)"
:extras="extras"
:mode="(((layout as string) === 'proof') ? 'row' : 'grid')"
/>
</template>
<template v-if="((layout as string) === 'proof')">
<MediaReview v-if="((extras.reviews?.length ?? 0) > 0)" :extras="extras" :labels="labels" />
</template>
<template v-if="((layout as string) === 'steps')">
<MediaSteps v-if="((extras.steps?.length ?? 0) > 0)" :extras="extras" :labels="labels" />
</template>
<template v-if="((layout as string) === 'posts')">
<MediaPosts v-if="((extras.posts?.length ?? 0) > 0)" :extras="extras" :labels="labels" />
</template>
<template v-if="((layout as string) === 'topics')">
<MediaTopics v-if="((extras.topics?.length ?? 0) > 0)" :extras="extras" :labels="labels" />
</template>
<template v-if="((layout as string) === 'contact')">
<MediaContacts v-if="((extras.channels?.length ?? 0) > 0)" :extras="extras" :labels="labels" />
</template>
<ActionGroup v-if="((layout as string) !== 'contact')"
:primary="actions.cta"
:primaryHref="actions.href"
:secondary="((actions.mode === 'two') ? actions.secondary : undefined)"
:secondaryHref="actions.secondaryHref"
/>
<template #aside>
<MediaFrame
:alt="(imageAlt ? imageAlt : title)"
:src="image"
:ratio="((((layout as string) === 'steps') || ((layout as string) === 'topics')) ? '1/1' : '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 media-list// 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 list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures
* and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts,
* contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
*/
import { type JSX } from "solid-js";
import { ActionGroup } from "../components/action-group";
import { MediaContacts } from "../components/media-contacts";
import { MediaFigures } from "../components/media-figures";
import { MediaFrame } from "../components/media-frame";
import { MediaPosts } from "../components/media-posts";
import { MediaReview } from "../components/media-review";
import { MediaSteps } from "../components/media-steps";
import { MediaTopics } from "../components/media-topics";
import { SectionFrame } from "../components/section-frame";
import type { MediaExtras, MediaListLabels } from "./media-list.types";
import type { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
import type { LinkActions } from "./error-page.types";
export type MediaListProps = {
id: string;
title: string;
lead?: string;
badge?: string;
extras: MediaExtras;
labels: MediaListLabels;
actions: LinkActions;
layout?: "figures" | "proof" | "steps" | "posts" | "topics" | "contact";
mediaSide?: "end" | "start";
tone?: "default" | "muted";
image?: string;
imageAlt?: string;
landmarkLabel?: string;
};
export function MediaList({
id,
title,
lead = "",
badge = "",
extras,
labels,
actions,
layout = "figures",
mediaSide = "end",
tone = "default",
image,
imageAlt,
landmarkLabel,
}: MediaListProps) {
return (
<SectionFrame
id={id}
title={title}
lead={lead}
heading={{ badge }}
tone={tone}
layout="split"
media={{ show: true, side: mediaSide }}
landmarkLabel={landmarkLabel}
aside={(
<MediaFrame
alt={(imageAlt ? imageAlt : title)}
src={image}
ratio={((((layout as string) === "steps") || ((layout as string) === "topics")) ? "1/1" : "4/3")}
/>
)}
>
{(((layout as string) === "figures") || ((layout as string) === "proof")) ? (
<>
{((extras.stats?.length ?? 0) > 0) ? (
<MediaFigures extras={extras} mode={(((layout as string) === "proof") ? "row" : "grid")} />
) : null}
</>
) : null}
{((layout as string) === "proof") ? (
<>
{((extras.reviews?.length ?? 0) > 0) ? (
<MediaReview extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "steps") ? (
<>
{((extras.steps?.length ?? 0) > 0) ? (
<MediaSteps extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "posts") ? (
<>
{((extras.posts?.length ?? 0) > 0) ? (
<MediaPosts extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "topics") ? (
<>
{((extras.topics?.length ?? 0) > 0) ? (
<MediaTopics extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) === "contact") ? (
<>
{((extras.channels?.length ?? 0) > 0) ? (
<MediaContacts extras={extras} labels={labels} />
) : null}
</>
) : null}
{((layout as string) !== "contact") ? (
<ActionGroup
primary={actions.cta}
primaryHref={actions.href}
secondary={((actions.mode === "two") ? actions.secondary : undefined)}
secondaryHref={actions.secondaryHref}
/>
) : null}
</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.
import type { Stat } from "./stats-band.types";
import type { Step } from "./steps-list.types";
import type { Post } from "./post-card.types";
import type { Category } from "./category-nav.types";
import type { Feature } from "./feature-grid.types";
import type { Review } from "./review-list.types";
export type MediaExtras = {
stats: Stat[];
steps: Step[];
posts: Post[];
topics: Category[];
channels: Feature[];
reviews: Review[];
};
export type MediaListLabels = {
list: string;
count: string;
minutes: string;
featured: string;
rating: string;
figures: 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 media-list// 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/media-list.json
package blocks
import (
uiutils "github.com/ui8kit/codegen/generated/templ/orgutils"
)
// MediaListProps are the props of MediaList; the values are the JSON shapes of the TypeScript props.
type MediaListProps struct {
Id any `json:"id"`
Title any `json:"title"`
Lead any `json:"lead"`
Badge any `json:"badge"`
Extras any `json:"extras"`
Labels any `json:"labels"`
Actions any `json:"actions"`
Layout any `json:"layout"`
MediaSide any `json:"mediaSide"`
Tone any `json:"tone"`
Image any `json:"image"`
ImageAlt any `json:"imageAlt"`
LandmarkLabel any `json:"landmarkLabel"`
}
// A list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts, contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
templ MediaList(p MediaListProps) {
{{ vId := p.Id }}
{{ vTitle := p.Title }}
{{ vLead := uiutils.Def(p.Lead, "") }}
{{ vBadge := uiutils.Def(p.Badge, "") }}
{{ vExtras := p.Extras }}
{{ vLabels := p.Labels }}
{{ vActions := p.Actions }}
{{ vLayout := uiutils.Def(p.Layout, "figures") }}
{{ vMediaSide := uiutils.Def(p.MediaSide, "end") }}
{{ vTone := uiutils.Def(p.Tone, "default") }}
{{ vImage := p.Image }}
{{ vImageAlt := p.ImageAlt }}
{{ vLandmarkLabel := p.LandmarkLabel }}
@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Lead: vLead, Heading: map[string]any{"badge": vBadge}, Tone: vTone, Layout: "split", Media: map[string]any{"show": true, "side": vMediaSide}, LandmarkLabel: vLandmarkLabel, Aside: mediaListFill1(p, vTitle, vLayout, vImage, vImageAlt)}) {
if uiutils.T(uiutils.Or(uiutils.Eq(vLayout, "figures"), uiutils.Eq(vLayout, "proof"))) {
if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "stats")), float64(0)) {
@MediaFigures(MediaFiguresProps{Extras: vExtras, Mode: uiutils.Cond(uiutils.T(uiutils.Eq(vLayout, "proof")), "row", "grid")})
}
}
if uiutils.Eq(vLayout, "proof") {
if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "reviews")), float64(0)) {
@MediaReview(MediaReviewProps{Extras: vExtras, Labels: vLabels})
}
}
if uiutils.Eq(vLayout, "steps") {
if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "steps")), float64(0)) {
@MediaSteps(MediaStepsProps{Extras: vExtras, Labels: vLabels})
}
}
if uiutils.Eq(vLayout, "posts") {
if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "posts")), float64(0)) {
@MediaPosts(MediaPostsProps{Extras: vExtras, Labels: vLabels})
}
}
if uiutils.Eq(vLayout, "topics") {
if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "topics")), float64(0)) {
@MediaTopics(MediaTopicsProps{Extras: vExtras, Labels: vLabels})
}
}
if uiutils.Eq(vLayout, "contact") {
if uiutils.Gt(uiutils.Len(uiutils.Get(vExtras, "channels")), float64(0)) {
@MediaContacts(MediaContactsProps{Extras: vExtras, Labels: vLabels})
}
}
if !uiutils.Eq(vLayout, "contact") {
@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")})
}
}
}
templ mediaListFill1(p MediaListProps, vTitle any, vLayout any, vImage any, vImageAlt any) {
@MediaFrame(MediaFrameProps{Alt: uiutils.Cond(uiutils.T(vImageAlt), vImageAlt, vTitle), Src: vImage, Ratio: uiutils.Cond(uiutils.T(uiutils.Or(uiutils.Eq(vLayout, "steps"), uiutils.Eq(vLayout, "topics"))), "1/1", "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 media-list{#- 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/media-list.json
A list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts, contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
Props (p): id, title, lead, badge, extras, labels, actions, layout, mediaSide, tone, image, imageAlt, landmarkLabel. -#}
{%- set v_id = (p.id ?? null) -%}
{%- set v_title = (p.title ?? null) -%}
{%- set v_lead = (p.lead ?? '') -%}
{%- set v_badge = (p.badge ?? '') -%}
{%- set v_extras = (p.extras ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_actions = (p.actions ?? null) -%}
{%- set v_layout = (p.layout ?? 'figures') -%}
{%- set v_mediaSide = (p.mediaSide ?? 'end') -%}
{%- set v_tone = (p.tone ?? 'default') -%}
{%- set v_image = (p.image ?? null) -%}
{%- set v_imageAlt = (p.imageAlt ?? null) -%}
{%- set v_landmarkLabel = (p.landmarkLabel ?? null) -%}
{%- set f_1 -%}
{{ include('blocks/media-frame.html.twig', {'p': {'alt': (og_t(v_imageAlt) ? v_imageAlt : v_title), 'src': v_image, 'ratio': (og_t(og_or([og_eq(v_layout, 'steps'), og_eq(v_layout, 'topics')])) ? '1/1' : '4/3')}}, with_context = false) }}
{%- endset -%}
{%- set c_2 -%}
{%- if og_t(og_or([og_eq(v_layout, 'figures'), og_eq(v_layout, 'proof')])) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['stats'])), 0)) %}
{{ include('blocks/media-figures.html.twig', {'p': {'extras': v_extras, 'mode': (og_t(og_eq(v_layout, 'proof')) ? 'row' : 'grid')}}, with_context = false) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'proof')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['reviews'])), 0)) %}
{{ include('blocks/media-review.html.twig', {'p': {'extras': v_extras, 'labels': v_labels}}, with_context = false) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'steps')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['steps'])), 0)) %}
{{ include('blocks/media-steps.html.twig', {'p': {'extras': v_extras, 'labels': v_labels}}, with_context = false) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'posts')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['posts'])), 0)) %}
{{ include('blocks/media-posts.html.twig', {'p': {'extras': v_extras, 'labels': v_labels}}, with_context = false) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'topics')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['topics'])), 0)) %}
{{ include('blocks/media-topics.html.twig', {'p': {'extras': v_extras, 'labels': v_labels}}, with_context = false) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'contact')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['channels'])), 0)) %}
{{ include('blocks/media-contacts.html.twig', {'p': {'extras': v_extras, 'labels': v_labels}}, with_context = false) }}
{%- endif %}
{%- endif %}
{%- if og_t(not (og_eq(v_layout, 'contact'))) %}
{{ 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'])}}, with_context = false) }}
{%- endif %}
{%- endset -%}
{{ include('blocks/section-frame.html.twig', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'heading': {'badge': v_badge}, 'tone': v_tone, 'layout': 'split', 'media': {'show': true, 'side': v_mediaSide}, 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_1)}, 'children': og_markup(c_2)}, 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 media-list{* 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/media-list.json
A list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts, contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
Props (p): id, title, lead, badge, extras, labels, actions, layout, mediaSide, tone, image, imageAlt, landmarkLabel. *}
{var $v_id = ($p['id'] ?? null)}
{var $v_title = ($p['title'] ?? null)}
{var $v_lead = ($p['lead'] ?? '')}
{var $v_badge = ($p['badge'] ?? '')}
{var $v_extras = ($p['extras'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_actions = ($p['actions'] ?? null)}
{var $v_layout = ($p['layout'] ?? 'figures')}
{var $v_mediaSide = ($p['mediaSide'] ?? 'end')}
{var $v_tone = ($p['tone'] ?? 'default')}
{var $v_image = ($p['image'] ?? null)}
{var $v_imageAlt = ($p['imageAlt'] ?? null)}
{var $v_landmarkLabel = ($p['landmarkLabel'] ?? null)}
{capture $f_1}
{=og_include('blocks/media-frame.latte', ['p' => ['alt' => (og_t($v_imageAlt) ? $v_imageAlt : $v_title), 'src' => $v_image, 'ratio' => (og_t(og_or([og_eq($v_layout, 'steps'), og_eq($v_layout, 'topics')])) ? '1/1' : '4/3')]])|noescape}
{/capture}
{capture $c_2}
{if og_t(og_or([og_eq($v_layout, 'figures'), og_eq($v_layout, 'proof')]))}
{if og_t(og_gt(og_len(og_get($v_extras, ['stats'])), 0))}
{=og_include('blocks/media-figures.latte', ['p' => ['extras' => $v_extras, 'mode' => (og_t(og_eq($v_layout, 'proof')) ? 'row' : 'grid')]])|noescape}
{/if}
{/if}
{if og_t(og_eq($v_layout, 'proof'))}
{if og_t(og_gt(og_len(og_get($v_extras, ['reviews'])), 0))}
{=og_include('blocks/media-review.latte', ['p' => ['extras' => $v_extras, 'labels' => $v_labels]])|noescape}
{/if}
{/if}
{if og_t(og_eq($v_layout, 'steps'))}
{if og_t(og_gt(og_len(og_get($v_extras, ['steps'])), 0))}
{=og_include('blocks/media-steps.latte', ['p' => ['extras' => $v_extras, 'labels' => $v_labels]])|noescape}
{/if}
{/if}
{if og_t(og_eq($v_layout, 'posts'))}
{if og_t(og_gt(og_len(og_get($v_extras, ['posts'])), 0))}
{=og_include('blocks/media-posts.latte', ['p' => ['extras' => $v_extras, 'labels' => $v_labels]])|noescape}
{/if}
{/if}
{if og_t(og_eq($v_layout, 'topics'))}
{if og_t(og_gt(og_len(og_get($v_extras, ['topics'])), 0))}
{=og_include('blocks/media-topics.latte', ['p' => ['extras' => $v_extras, 'labels' => $v_labels]])|noescape}
{/if}
{/if}
{if og_t(og_eq($v_layout, 'contact'))}
{if og_t(og_gt(og_len(og_get($v_extras, ['channels'])), 0))}
{=og_include('blocks/media-contacts.latte', ['p' => ['extras' => $v_extras, 'labels' => $v_labels]])|noescape}
{/if}
{/if}
{if og_t(!(og_eq($v_layout, 'contact')))}
{=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'])]])|noescape}
{/if}
{/capture}
{=og_include('blocks/section-frame.latte', ['p' => ['id' => $v_id, 'title' => $v_title, 'lead' => $v_lead, 'heading' => ['badge' => $v_badge], 'tone' => $v_tone, 'layout' => 'split', 'media' => ['show' => true, 'side' => $v_mediaSide], 'landmarkLabel' => $v_landmarkLabel, 'aside' => og_markup($f_1)], 'children' => og_markup($c_2)])|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 media-list{#- 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/media-list.json
A list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts, contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
Props (p): id, title, lead, badge, extras, labels, actions, layout, mediaSide, tone, image, imageAlt, landmarkLabel. -#}
{%- set v_id = og_def(p['id'], none) -%}
{%- set v_title = og_def(p['title'], none) -%}
{%- set v_lead = og_def(p['lead'], '') -%}
{%- set v_badge = og_def(p['badge'], '') -%}
{%- set v_extras = og_def(p['extras'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_actions = og_def(p['actions'], none) -%}
{%- set v_layout = og_def(p['layout'], 'figures') -%}
{%- set v_mediaSide = og_def(p['mediaSide'], 'end') -%}
{%- set v_tone = og_def(p['tone'], '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 f_1 -%}
{{ og_include('blocks/media-frame.html.j2', {'p': {'alt': (v_imageAlt if og_t(v_imageAlt) else v_title), 'src': v_image, 'ratio': ('1/1' if og_t(og_or([og_eq(v_layout, 'steps'), og_eq(v_layout, 'topics')])) else '4/3')}}) }}
{%- endset -%}
{%- set c_2 -%}
{%- if og_t(og_or([og_eq(v_layout, 'figures'), og_eq(v_layout, 'proof')])) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['stats'])), 0)) %}
{{ og_include('blocks/media-figures.html.j2', {'p': {'extras': v_extras, 'mode': ('row' if og_t(og_eq(v_layout, 'proof')) else 'grid')}}) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'proof')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['reviews'])), 0)) %}
{{ og_include('blocks/media-review.html.j2', {'p': {'extras': v_extras, 'labels': v_labels}}) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'steps')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['steps'])), 0)) %}
{{ og_include('blocks/media-steps.html.j2', {'p': {'extras': v_extras, 'labels': v_labels}}) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'posts')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['posts'])), 0)) %}
{{ og_include('blocks/media-posts.html.j2', {'p': {'extras': v_extras, 'labels': v_labels}}) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'topics')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['topics'])), 0)) %}
{{ og_include('blocks/media-topics.html.j2', {'p': {'extras': v_extras, 'labels': v_labels}}) }}
{%- endif %}
{%- endif %}
{%- if og_t(og_eq(v_layout, 'contact')) %}
{%- if og_t(og_gt(og_len(og_get(v_extras, ['channels'])), 0)) %}
{{ og_include('blocks/media-contacts.html.j2', {'p': {'extras': v_extras, 'labels': v_labels}}) }}
{%- endif %}
{%- endif %}
{%- if og_t(not (og_eq(v_layout, 'contact'))) %}
{{ 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'])}}) }}
{%- endif %}
{%- endset -%}
{{ og_include('blocks/section-frame.html.j2', {'p': {'id': v_id, 'title': v_title, 'lead': v_lead, 'heading': {'badge': v_badge}, 'tone': v_tone, 'layout': 'split', 'media': {'show': true, 'side': v_mediaSide}, 'landmarkLabel': v_landmarkLabel, 'aside': og_markup(f_1)}, 'children': og_markup(c_2)}) }}
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 list or figures beside a picture. Axes: layout (figures: four figures in two columns, proof: three figures and a featured review, steps: numbered steps, posts: the latest posts, topics: topic rows with counts, contact: contact buttons and support figures), mediaSide, tone. The actions follow every layout but contact.
| Prop | Type | Default | Description |
|---|---|---|---|
| id (required) | string | - | |
| title (required) | string | - | |
| lead | string | "" | |
| badge | string | "" | a short pill above the heading |
| extras (required) | MediaExtras | - | the figures, steps, posts, topics, channels and reviews |
| labels (required) | MediaListLabels | - | the heading of the list; templates: count `{0} articles`, minutes `{0} min read`, rating `{0} out of 5`; the featured-review and figures headings |
| actions (required) | LinkActions | - | |
| layout | "figures" | "proof" | "steps" | "posts" | "topics" | "contact" | "figures" | |
| mediaSide | "end" | "start" | "end" | |
| tone | "default" | "muted" | "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 |