Page sections / Feature sections

Challenge-Solution Case Study

Left column of marker-ruled labels (Challenge, Solution, Products) with muted paragraphs and a check-bullet purple product list. On the right an app screenshot in a phone frame overlaps a rounded photo. A row of logos beneath is dimmed, with the active one in full color and a colored top rule.

Rebuilt from stripe.com/customers in the Iridescent Ledger style.

npx shadcn@latest add https://justyoink.it/r/iridescent-ledger/blocks/case-study-split.json

Looks exactly like stripe.com: brings its fonts and colours, namespaced so your own theme stays untouched.

Images4 in this component. Swap any for a library image or one of your own.All images in this style →

Choose an image

Image

Loading…

Usage

Pass `cases` (array of id, name, color, title, challenge, solution, products, photo, amount, phoneColor) plus optional eyebrow, heading and intro. Clicking a logo in the bottom row switches the displayed case study.

components/case-study-split.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
import { useState } from "react";

type Case = {
  id: string;
  name: string;
  color: string;
  title: string;
  challenge: string;
  solution: string;
  products: string[];
  photo: string;
  amount: string;
  phoneColor: string;
};

const DEFAULT_CASES: Case[] = [
  {
    id: "kitefield",
    name: "Kitefield",
    color: "#e0359a",
    title: "How we built same-day settlements with Kitefield",
    challenge:
      "Couriers asked for a quicker way to access their earnings instead of waiting for the end of the month, so the team needed a flexible payout flow.",
    solution:
      "Kitefield teamed up with us on a self-serve cash-out tool, letting couriers pick the moment their funds arrive, often by the same afternoon.",
    products: ["Wallets", "Transfers"],
    photo: "https://yoink-app.fly.dev/stock/people-2.jpg",
    amount: "$218.40",
    phoneColor: "#e0359a",
  },
  {
    id: "northwind",
    name: "Northwind",
    color: "#0f8a6d",
    title: "How we built smarter billing with Northwind",
    challenge:
      "Shop owners wanted invoices that adapt to seasonal demand, but the legacy billing stack could only handle one fixed monthly plan.",
    solution:
      "Northwind adopted usage-based invoicing with automated reminders, so merchants are charged fairly and collect revenue with less manual follow-up.",
    products: ["Invoicing", "Subscriptions", "Reports"],
    photo: "https://yoink-app.fly.dev/stock/workspace-1.jpg",
    amount: "$1,094.00",
    phoneColor: "#0f8a6d",
  },
  {
    id: "altura",
    name: "Altura",
    color: "#e8743b",
    title: "How we built global checkout with Altura",
    challenge:
      "Altura's shoppers abroad abandoned carts because their preferred local payment methods were missing at the final step.",
    solution:
      "Together we launched a localized checkout that shows familiar methods per region and converts more international visitors into buyers.",
    products: ["Checkout", "Currency"],
    photo: "https://yoink-app.fly.dev/stock/product-1.jpg",
    amount: "$76.25",
    phoneColor: "#e8743b",
  },
  {
    id: "lumen",
    name: "Lumen",
    color: "#5b4be0",
    title: "How we built fraud shields with Lumen",
    challenge:
      "Lumen saw rising chargebacks and needed protection that wouldn't block honest customers at the door.",
    solution:
      "We tuned adaptive risk rules around Lumen's own order patterns, cutting disputes while keeping approvals high.",
    products: ["Risk", "Disputes", "Payments"],
    photo: "https://yoink-app.fly.dev/stock/workspace-3.jpg",
    amount: "$530.10",
    phoneColor: "#5b4be0",
  },
];

function Mark({ id, color }: { id: string; color: string }) {
  const shape =
    id === "kitefield" ? (
      <path d="M12 2l10 10-10 10L2 12z" fill={color} />
    ) : id === "northwind" ? (
      <circle cx="12" cy="12" r="10" fill={color} />
    ) : id === "altura" ? (
      <path d="M12 3l10 18H2z" fill={color} />
    ) : (
      <rect x="3" y="3" width="18" height="18" rx="5" fill={color} />
    );
  return (
    <svg viewBox="0 0 24 24" className="h-6 w-6" aria-hidden="true">
      {shape}
    </svg>
  );
}

export default function ChallengeSolutionCaseStudy(props: {
  eyebrow?: string;
  heading?: string;
  intro?: string;
  cases?: Case[];
}) {
  const {
    eyebrow = "Shipping side by side",
    heading = "We work hand in hand with teams to launch bold ideas",
    intro = "Our platform evolves quickly and ships purpose-built tools shaped around what each customer asks for.",
    cases = DEFAULT_CASES,
  } = props;
  const [active, setActive] = useState(0);
  const c = cases[active];

  return (
    <section className="bg-canvas text-ink font-sans">
      <div className="mx-auto max-w-[1080px] border-x border-dashed border-hairline">
        <div className="px-4 pt-20 md:pt-32">
          <p className="text-lead font-medium text-accent">{eyebrow}</p>
          <h2 className="mt-6 max-w-[620px] text-h1 font-semibold text-ink-deep">{heading}</h2>
          <p className="mt-6 max-w-[620px] text-lead text-ink-muted">{intro}</p>
        </div>

        <div key={c.id} className="mt-20 grid gap-12 px-4 pb-20 md:grid-cols-2">
          <div>
            <h3 className="text-h2 font-semibold text-ink-deep">{c.title}</h3>
            <div className="mt-10 space-y-8">
              {[
                { l: "Challenge", t: c.challenge },
                { l: "Solution", t: c.solution },
              ].map((b) => (
                <div key={b.l} className="relative">
                  <span className="absolute -left-4 top-1 h-4 w-px bg-accent" />
                  <h4 className="text-body font-semibold text-ink-deep">{b.l}</h4>
                  <p className="mt-3 max-w-[420px] text-body text-ink-muted">{b.t}</p>
                </div>
              ))}
              <div className="relative">
                <span className="absolute -left-4 top-1 h-4 w-px bg-accent" />
                <h4 className="text-body font-semibold text-ink-deep">Products</h4>
                <ul className="mt-3 space-y-1">
                  {c.products.map((p) => (
                    <li key={p} className="flex items-center gap-2 text-body font-medium text-accent">
                      <span className="flex h-4 w-4 items-center justify-center rounded-pill bg-accent-wash">
                        <svg viewBox="0 0 12 12" className="h-2.5 w-2.5" fill="none" stroke="currentColor" strokeWidth="1.8"><path d="M3 6.2l2 2 4-4.4" /></svg>
                      </span>
                      {p}
                    </li>
                  ))}
                </ul>
              </div>
            </div>
          </div>

          <Reveal from="up" className="relative min-h-[460px]">
            <img
              src={c.photo}
              alt="People working together"
              width={267}
              height={406}
              loading="lazy"
              className="absolute bottom-0 right-0 h-[406px] w-[267px] rounded-md object-cover shadow-floating"
            />
            <div className="absolute left-0 top-0 w-[248px] rounded-[36px] border border-hairline bg-surface p-1.5 shadow-floating sm:left-8">
              <div className="overflow-hidden rounded-[30px] bg-surface">
                <div className="flex h-11 items-center justify-center" style={{ background: c.phoneColor }}>
                  <span className="h-3 w-3 rounded-pill bg-surface" />
                </div>
                <div className="px-4 py-3 text-center">
                  <p className="text-ui font-medium text-ink-deep">Today</p>
                  <p className="text-micro text-ink-faint">Payments</p>
                  <p className="my-1 text-h2 font-semibold text-ink-deep">{c.amount}</p>
                  <div className="mt-2 flex justify-around text-micro text-ink-faint">
                    <span>Orders<br /><b className="text-ui text-ink-deep">12</b></span>
                    <span>Time<br /><b className="text-ui text-ink-deep">4h 19m</b></span>
                  </div>
                </div>
                <div className="space-y-2 bg-surface-tint p-3">
                  <p className="text-micro text-ink-faint">Balance</p>
                  <div className="flex items-center justify-between rounded-sm bg-surface p-2 shadow-raised">
                    <span className="text-caption text-ink-deep">{c.amount}</span>
                    <span className="rounded-xs px-2 py-0.5 text-micro font-semibold text-surface" style={{ background: c.phoneColor }}>CASH OUT</span>
                  </div>
                  <p className="text-micro text-ink-faint">Busy hours</p>
                  {[60, 80].map((w) => (
                    <div key={w} className="flex items-center justify-between rounded-sm bg-surface p-2 shadow-raised">
                      <span className="text-caption text-ink-deep">{w === 60 ? "7:00 - 9:00 PM" : "10:00 - 12:00 AM"}</span>
                      <span className="h-1 w-12 rounded-pill bg-hairline"><span className="block h-1 rounded-pill bg-accent" style={{ width: w + "%" }} /></span>
                    </div>
                  ))}
                  <div className="h-16" />
                </div>
                <div className="flex justify-around border-t border-hairline py-2 text-micro text-ink-faint">
                  <span>Home</span><span className="text-accent">Earnings</span><span>Invites</span>
                </div>
              </div>
            </div>
          </Reveal>
        </div>

        <div className="grid grid-cols-2 border-t border-dashed border-hairline md:grid-cols-4">
          {cases.map((x, i) => {
            const on = i === active;
            return (
              <button
                key={x.id}
                type="button"
                onClick={() => setActive(i)}
                aria-pressed={on}
                aria-label={x.name}
                className="flex h-40 items-start justify-center border-t-2 pt-10 transition-all duration-smooth ease-smooth focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent"
                style={{ borderColor: on ? x.color : "transparent", opacity: on ? 1 : 0.55, filter: on ? "none" : "grayscale(1)" }}
              >
                <span className="flex items-center gap-2 text-h3 font-semibold" style={{ color: x.color }}>
                  <Mark id={x.id} color={x.color} />
                  {x.name}
                </span>
              </button>
            );
          })}
        </div>
      </div>
    </section>
  );
}

// ---- Yoink motion (inlined, no dependencies): Reveal ----

const YK_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";

const useYkLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;

function ykReducedMotion(): boolean {
  return typeof window !== "undefined" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches;
}

// "idle": untouched (visible) · "hidden": waiting below the fold · "shown": play the entrance.
// Content is only hidden once we know we can show it again (IntersectionObserver exists, motion allowed,
// and there is a box to watch), and a safety net reveals anything on screen that is still hidden.
type YkRevealState = "idle" | "hidden" | "shown";

function useYkReveal(ref: RefObject<Element | null>, once = true): YkRevealState {
  const [state, setState] = useState<YkRevealState>("idle");
  useYkLayoutEffect(() => {
    const el = ref.current;
    if (!el || ykReducedMotion() || typeof IntersectionObserver === "undefined") return;
    // watch the element's own box, or its children when it has none (display: contents)
    const boxes = () => (getComputedStyle(el).display === "contents" ? Array.from(el.children) : [el]);
    const onScreen = (t: Element) => {
      const r = t.getBoundingClientRect();
      return (r.width > 0 || r.height > 0) && r.bottom > 0 && r.right > 0 && r.top < window.innerHeight && r.left < window.innerWidth;
    };
    if (!boxes().some((t) => t.getBoundingClientRect().width > 0 || t.getBoundingClientRect().height > 0)) return; // e.g. hidden at mount: leave it visible
    let shown = false;
    const show = (v: boolean) => {
      if (v !== shown) (shown = v), setState(v ? "shown" : "hidden");
    };
    setState("hidden");
    const inView = new Set<Element>();
    const io = new IntersectionObserver((entries) => {
      for (const e of entries) {
        if (e.isIntersecting) inView.add(e.target);
        else inView.delete(e.target);
      }
      if (inView.size) {
        show(true);
        if (once) io.disconnect();
      } else if (!once) show(false);
    });
    const watched = new Set<Element>();
    const watch = () => boxes().forEach((t) => !watched.has(t) && (watched.add(t), io.observe(t)));
    watch();
    // safety net: styles that land after mount (display: contents) get watched too, and nothing
    // stays hidden for more than a moment while it is actually on screen
    const start = Date.now();
    const net = setInterval(() => {
      if (shown) return once && clearInterval(net);
      watch();
      if (Date.now() - start > 2400 && boxes().some(onScreen)) show(true);
    }, 600);
    return () => {
      io.disconnect();
      clearInterval(net);
    };
  }, [once]);
  return state;
}

type YkRevealFrom = "up" | "down" | "left" | "right" | "scale" | "blur" | "none";

/** Fades content in as it scrolls into view. */
function Reveal({
  children,
  from = "up",
  delay = 0,
  duration = 700,
  distance = 24,
  once = true,
  as = "div",
  className,
  style,
}: {
  children?: ReactNode;
  from?: YkRevealFrom;
  delay?: number;
  duration?: number;
  distance?: number;
  once?: boolean;
  as?: ElementType;
  className?: string;
  style?: CSSProperties;
}) {
  const Tag = as;
  const ref = useRef<HTMLElement>(null);
  const state = useYkReveal(ref, once);
  const hidden = state === "hidden";
  const offset = {
    up: `translate3d(0, ${distance}px, 0)`,
    down: `translate3d(0, ${-distance}px, 0)`,
    left: `translate3d(${-distance}px, 0, 0)`,
    right: `translate3d(${distance}px, 0, 0)`,
    scale: "scale(0.94)",
    blur: `translate3d(0, ${distance / 2}px, 0)`,
    none: "none",
  }[from];
  const t = `${duration}ms ${YK_EASE} ${delay}ms`;
  return (
    <Tag
      ref={ref}
      className={className}
      style={{
        ...style,
        ...(hidden && { opacity: 0, transform: offset, filter: from === "blur" ? "blur(12px)" : undefined }),
        ...(state === "shown" && { transition: `opacity ${t}, transform ${t}, filter ${t}` }),
      }}
    >
      {children}
    </Tag>
  );
}

Quality checks

Automated, in a real browser · 5d ago
—

More from Iridescent Ledger

The whole style →

Checklist Feature Columns

Feature sections

Iridescent Ribbon Hero

Heroes

Dated Article Row

Blog & articles

Saturated Highlight Card Strip

Carousels

Frosted Hairline Header

Headers & nav bars

Sticky Pill Sub-Navigation

Tab bars