Page sections / Feature sections

Hairline Triple Feature Strip

A single rounded 15px bordered container split into three equal columns by 1px dividers; each has an outline icon, white title and grey body text. Sits below a small editor screenshot.

Rebuilt from framer.com in the Obsidian Canvas style.

npx shadcn@latest add https://justyoink.it/r/obsidian-canvas-cc37fa/blocks/hairline-triple-feature.json

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

Usage

Pass `heading` and a `features` array of {title, body, icon: 'spark' | 'cursor' | 'rocket'}. Renders standalone with defaults; cells brighten their background on hover.

components/hairline-triple-feature.tsx
"use client";

import { useEffect, useLayoutEffect, useRef, useState, type CSSProperties, type ElementType, type ReactNode, type RefObject } from "react";
type Feature = { title: string; body: string; icon: "spark" | "cursor" | "rocket" };

type Props = {
  heading?: string;
  features?: Feature[];
};

const defaults: Feature[] = [
  { title: "Sketch with a prompt", body: "Tell the assistant what you want, and it drafts pages, sections and reusable blocks within moments.", icon: "spark" },
  { title: "Fine-tune visually", body: "Every element remains editable. Tweak spacing, type, layouts and motion until it matches your vision.", icon: "cursor" },
  { title: "Go live in one click", body: "Hosting, content tools, analytics and search setup come built in, so launching needs no extra pipeline.", icon: "rocket" },
];

function Icon({ name }: { name: Feature["icon"] }) {
  const c = { width: 22, height: 22, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.4, strokeLinejoin: "round" as const, "aria-hidden": true };
  if (name === "spark") return <svg {...c}><path d="M12 2c1 5 4 8 10 10-6 2-9 5-10 10-1-5-4-8-10-10 6-2 9-5 10-10z" /></svg>;
  if (name === "cursor") return <svg {...c}><path d="M3 3l18 7-7 3-3 8z" /></svg>;
  return <svg {...c}><path d="M12 2c3 3 4 7 3 12H9c-1-5 0-9 3-12zM9 14l-3 4h12l-3-4M12 18v4" /></svg>;
}

export default function HairlineTripleFeatureStrip({ heading = "The site studio for launching polished pages", features = defaults }: Props) {
  return (
    <section className="bg-canvas px-5 py-16 text-primary md:px-[120px]">
      <div className="mx-auto max-w-[1200px]">
        <h2 className="max-w-[460px] font-display text-h2 text-primary">{heading}</h2>

        <Reveal from="scale" className="mx-auto my-10 w-full max-w-[200px]">
          <div className="overflow-hidden rounded-md border border-hairline bg-surface shadow-inner-outline" aria-label="Editor preview" role="img">
            <div className="flex h-3 items-center gap-1 border-b border-hairline-soft px-1.5">
              <span className="h-1 w-1 rounded-full bg-faint" />
              <span className="h-1 w-1 rounded-full bg-faint" />
              <span className="ml-auto h-1 w-4 rounded-sm bg-accent-blue" />
            </div>
            <div className="grid h-[120px] grid-cols-[30%_1fr_28%]">
              <div className="space-y-1 border-r border-hairline-soft p-1.5">
                {[0, 1, 2, 3, 4, 5].map((i) => <div key={i} className="h-1 rounded-sm bg-surface-high" style={{ width: `${90 - i * 8}%` }} />)}
              </div>
              <div className="flex flex-col items-center gap-2 bg-canvas p-2">
                <div className="h-1.5 w-3/4 rounded-sm bg-primary/80" />
                <div className="flex gap-1.5">
                  {[0, 1, 2].map((i) => <span key={i} className="h-6 w-6 rounded-full bg-accent-deep-blue" />)}
                </div>
                <div className="mt-auto h-8 w-full rounded-sm bg-surface-raised" />
              </div>
              <div className="space-y-1 border-l border-hairline-soft p-1.5">
                {[0, 1, 2, 3].map((i) => <div key={i} className="h-2 rounded-sm bg-surface-raised" />)}
              </div>
            </div>
          </div>
        </Reveal>

        <ul className="grid overflow-hidden rounded-[15px] border border-hairline bg-canvas md:grid-cols-3">
          {features.map((f, i) => (
            <li key={f.title} className={`p-[30px] transition-colors duration-surface-hover ease-surface-hover hover:bg-surface ${i > 0 ? "border-t border-hairline md:border-l md:border-t-0" : ""}`}>
              <div className="mb-9 text-primary"><Icon name={f.icon} /></div>
              <h3 className="text-ui text-primary">{f.title}</h3>
              <p className="mt-1 max-w-[290px] text-ui text-muted">{f.body}</p>
            </li>
          ))}
        </ul>
      </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 · 4d ago
—

More from Obsidian Canvas

The whole style →

Minimal Black Header

Headers & nav bars

Platform Bento Grid

Feature sections

Audience Icon Grid

Feature sections

Sticky-date Changelog Entry

Changelog

Neon Agent Prompt Hero

Heroes

App-Window Marketplace Browser

Media & mockups