Skip to content
ui8kit

component / components

Quote Slot

Quote Slot component

Install

npx ui8kit add quote-slot

Pulls in: box, compose, kit-box, quote-card, testimonial-grid, utils

Preview

We moved our marketing site in a week and the pages got faster.

Mara Quinn

Head of Growth, Lumen

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 quote-slot
components/quote-slot.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. -->
<!--
  One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in
  a box that can span grid rows.
-->
<script lang="ts" module>
  import type { Snippet } from "svelte";
  import type { Quote, QuoteLabels } from "../blocks/testimonial-grid.types";

  export type QuoteSlotProps = {
    q: Quote;
    labels: QuoteLabels;
    kind?: "card" | "plain";
    layout?: "grid" | "single" | "stack";
    class?: string;
  };
</script>

<script lang="ts">
  import Box from "../compose/Box.svelte";
  import QuoteCard from "../components/quote-card.svelte";

  let { q, labels, kind = "card", layout = "grid", class: className }: QuoteSlotProps = $props();
</script>

<Box class={className} data-slot="quote">
  <QuoteCard q={q} labels={labels} item={{ kind, avatar: "image", rating: "show", mark: "none" }} layout={layout} />
</Box>

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 quote-slot
components/quote-slot.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.
/**
 * One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in
 * a box that can span grid rows.
 */
import { type ReactNode } from "react";
import { Box } from "../compose";
import { QuoteCard } from "../components/quote-card";
import type { Quote, QuoteLabels } from "../blocks/testimonial-grid.types";

export type QuoteSlotProps = {
  q: Quote;
  labels: QuoteLabels;
  kind?: "card" | "plain";
  layout?: "grid" | "single" | "stack";
  className?: string;
};

export function QuoteSlot({ q, labels, kind = "card", layout = "grid", className }: QuoteSlotProps) {
  return (
    <Box className={className} data-slot="quote">
      <QuoteCard q={q} labels={labels} item={{ kind, avatar: "image", rating: "show", mark: "none" }} layout={layout} />
    </Box>
  );
}

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 quote-slot
components/quote-slot.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. -->
<!--
  One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in
  a box that can span grid rows.
-->
<script lang="ts">
import type { Quote, QuoteLabels } from "../blocks/testimonial-grid.types";

export type QuoteSlotProps = {
  q: Quote;
  labels: QuoteLabels;
  kind?: "card" | "plain";
  layout?: "grid" | "single" | "stack";
  class?: string;
};
</script>

<script setup lang="ts">
import Box from "../compose/Box.vue";
import QuoteCard from "../components/quote-card.vue";

const { q, labels, kind = "card", layout = "grid", class: className } = defineProps<QuoteSlotProps>();
</script>

<template>
  <Box :class="className" data-slot="quote">
    <QuoteCard
      :q="q"
      :labels="labels"
      :item="{ kind, avatar: 'image', rating: 'show', mark: 'none' }"
      :layout="layout"
    />
  </Box>
</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 quote-slot
components/quote-slot.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.
/**
 * One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in
 * a box that can span grid rows.
 */
import { type JSX } from "solid-js";
import { Box } from "../compose";
import { QuoteCard } from "../components/quote-card";
import type { Quote, QuoteLabels } from "../blocks/testimonial-grid.types";

export type QuoteSlotProps = {
  q: Quote;
  labels: QuoteLabels;
  kind?: "card" | "plain";
  layout?: "grid" | "single" | "stack";
  class?: string;
};

export function QuoteSlot({ q, labels, kind = "card", layout = "grid", class: className }: QuoteSlotProps) {
  return (
    <Box class={className} data-slot="quote">
      <QuoteCard q={q} labels={labels} item={{ kind, avatar: "image", rating: "show", mark: "none" }} layout={layout} />
    </Box>
  );
}

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 quote-slot
blocks/quote-slot.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/quote-slot.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"
)

// QuoteSlotProps are the props of QuoteSlot; the values are the JSON shapes of the TypeScript props.
type QuoteSlotProps struct {
	Q any `json:"q"`
	Labels any `json:"labels"`
	Kind any `json:"kind"`
	Layout any `json:"layout"`
	Class string `json:"className"`
}

// One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in a box that can span grid rows.
templ QuoteSlot(p QuoteSlotProps) {
	{{ vQ := p.Q }}
	{{ vLabels := p.Labels }}
	{{ vKind := uiutils.Def(p.Kind, "card") }}
	{{ vLayout := uiutils.Def(p.Layout, "grid") }}
	@compose.Box(compose.BoxProps{BoxProps: box.BoxProps{Class: uiutils.S(p.Class), Attrs: uiutils.Attrs("data-slot", "quote")}}) {
		@QuoteCard(QuoteCardProps{Q: vQ, Labels: vLabels, Item: map[string]any{"kind": vKind, "avatar": "image", "rating": "show", "mark": "none"}, Layout: vLayout})
	}
}

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 quote-slot
blocks/quote-slot.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/quote-slot.json
    One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in a box that can span grid rows.
    Props (p): q, labels, kind, layout, className. -#}
{%- set v_q = (p.q ?? null) -%}
{%- set v_labels = (p.labels ?? null) -%}
{%- set v_kind = (p.kind ?? 'card') -%}
{%- set v_layout = (p.layout ?? 'grid') -%}
{%- set c_1 -%}
  {{ include('blocks/quote-card.html.twig', {'p': {'q': v_q, 'labels': v_labels, 'item': {'kind': v_kind, 'avatar': 'image', 'rating': 'show', 'mark': 'none'}, 'layout': v_layout}}, with_context = false) }}
{%- endset -%}
{{ include('compose/Box.html.twig', {'class': og_s((p.className ?? '')), 'attrs': og_attrs(['data-slot', 'quote']), 'children': c_1}, 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 quote-slot
blocks/quote-slot.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/quote-slot.json
    One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in a box that can span grid rows.
    Props (p): q, labels, kind, layout, className. *}
{var $v_q = ($p['q'] ?? null)}
{var $v_labels = ($p['labels'] ?? null)}
{var $v_kind = ($p['kind'] ?? 'card')}
{var $v_layout = ($p['layout'] ?? 'grid')}
{capture $c_1}
  {=og_include('blocks/quote-card.latte', ['p' => ['q' => $v_q, 'labels' => $v_labels, 'item' => ['kind' => $v_kind, 'avatar' => 'image', 'rating' => 'show', 'mark' => 'none'], 'layout' => $v_layout]])|noescape}
{/capture}
{=og_include('compose/Box.latte', ['class' => og_s(($p['className'] ?? '')), 'attrs' => og_attrs(['data-slot', 'quote']), 'children' => (string) $c_1])|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 quote-slot
blocks/quote-slot.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/quote-slot.json
    One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in a box that can span grid rows.
    Props (p): q, labels, kind, layout, className. -#}
{%- set v_q = og_def(p['q'], none) -%}
{%- set v_labels = og_def(p['labels'], none) -%}
{%- set v_kind = og_def(p['kind'], 'card') -%}
{%- set v_layout = og_def(p['layout'], 'grid') -%}
{%- set c_1 -%}
  {{ og_include('blocks/quote-card.html.j2', {'p': {'q': v_q, 'labels': v_labels, 'item': {'kind': v_kind, 'avatar': 'image', 'rating': 'show', 'mark': 'none'}, 'layout': v_layout}}) }}
{%- endset -%}
{{ og_include('compose/box.html.j2', {'p': {'Class': og_s(og_def(p['className'], '')), 'Attrs': og_attrs(['data-slot', 'quote'])}, 'children': c_1}) }}

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.

One quote of QuoteSplit: a QuoteCard with the author's picture and the stars, as a card or a plain figure, in a box that can span grid rows.

Props of QuoteSlot
PropTypeDefault Description
q (required)Quote-
labels (required)QuoteLabels-
kind "card" | "plain""card"
layout "grid" | "single" | "stack""grid"

Used in