# Hero with tilted layered panels (透视双层面板首屏)

Left-aligned hero with two product panels in perspective: a ticket inbox behind and an AI reply draft in front, with the inbox fading out at the right and bottom edges. Flat and stacked on narrow containers.

- Ref: `component/hero-tilted-panels` (component · hero)
- Page: https://uifino.com/en/components/hero/hero-tilted-panels
- Markdown: https://uifino.com/md/components/hero-tilted-panels.md
- Preview image: https://uifino.com/blocks/covers/hero-tilted-panels-dark.webp

## Install

- shadcn: `npx shadcn@latest add "https://uifino.com/r/blocks/hero-tilted-panels.json"`
- UIFino CLI: `npx uifino@latest add component/hero-tilted-panels`

## Dependencies

`lucide-react`

## shadcn/ui components it builds on

- `avatar`, `badge`, `button`, `separator`. The shadcn CLI installs them together with the block.

## Layout borrowed from

- https://linear.app/agents: Left-aligned headline over panels that bleed off the edges. Borrowed the composition and restraint only; the tilt and the product UI are original

## Theme

The block reads the project's shadcn theme variables, so it follows whatever DESIGN.md the project uses and needs no options of its own.
To give the project the look of a UIFino brand or style, install its theme: `npx shadcn@latest add "https://uifino.com/r/themes/linear.json"`.

## Usage

The files under `examples/` show the block wired with content, including its loading, empty and error states where it has them.

## Files

| Path | Role | Size |
| :--- | :--- | ---: |
| components/blocks/hero-tilted-panels/examples/content.ts | demo | 3.8 KB |
| components/blocks/hero-tilted-panels/examples/default.tsx | demo | 238 B |
| components/blocks/hero-tilted-panels/hero-tilted-panels.tsx | source | 7.4 KB |

### components/blocks/hero-tilted-panels/hero-tilted-panels.tsx

```tsx
import type { ComponentProps, ReactNode } from "react";
import { ArrowUpRight, Check, Sparkles } from "lucide-react";
import { Avatar, AvatarFallback } from "@/components/ui/avatar";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import { cn } from "@/lib/utils";

export interface HeroTiltedPanelsAction {
  readonly label: string;
  readonly href?: string;
  readonly onClick?: () => void;
}

export interface HeroTiltedPanelsTicket {
  readonly id: string;
  readonly customer: string;
  readonly subject: string;
  readonly time: string;
  readonly tone: "ok" | "warn" | "muted";
  readonly selected?: boolean;
}

export interface HeroTiltedPanelsInbox {
  readonly title: string;
  readonly tabs: readonly string[];
  readonly tickets: readonly HeroTiltedPanelsTicket[];
}

export interface HeroTiltedPanelsReply {
  readonly agent: string;
  readonly customer: string;
  readonly customerMessage: string;
  readonly sourcesTitle: string;
  readonly sources: readonly string[];
  readonly draft: string;
  readonly confidence: string;
  readonly edit: HeroTiltedPanelsAction;
  readonly send: HeroTiltedPanelsAction;
}

export interface HeroTiltedPanelsProps {
  readonly title: string;
  readonly description: string;
  readonly primaryAction: HeroTiltedPanelsAction;
  readonly secondaryAction: HeroTiltedPanelsAction;
  readonly inbox: HeroTiltedPanelsInbox;
  readonly reply: HeroTiltedPanelsReply;
  readonly tilt?: "none" | "soft" | "strong";
}

const tiltClass: Record<NonNullable<HeroTiltedPanelsProps["tilt"]>, string> = {
  none: "",
  soft: "@3xl:rotate-x-3 @3xl:-rotate-y-5",
  strong: "@3xl:rotate-x-6 @3xl:-rotate-y-10"
};

function ActionButton({
  action,
  children,
  ...props
}: {
  readonly action: HeroTiltedPanelsAction;
  readonly children?: ReactNode;
} & Omit<ComponentProps<typeof Button>, "asChild" | "onClick" | "children">) {
  if (action.href) {
    return (
      <Button asChild {...props}>
        <a href={action.href} onClick={action.onClick}>
          {action.label}
          {children}
        </a>
      </Button>
    );
  }
  return (
    <Button onClick={action.onClick} {...props}>
      {action.label}
      {children}
    </Button>
  );
}

const dotTone: Record<HeroTiltedPanelsTicket["tone"], string> = {
  ok: "bg-chart-2",
  warn: "bg-chart-4",
  muted: "bg-muted-foreground/40"
};

export function HeroTiltedPanels({
  title,
  description,
  primaryAction,
  secondaryAction,
  inbox,
  reply,
  tilt = "strong"
}: HeroTiltedPanelsProps) {
  return (
    <section className="@container relative flex flex-col overflow-hidden bg-background text-foreground">
      <div className="mx-auto w-full max-w-6xl px-4 pt-16 @3xl:px-8 @3xl:pt-24">
        <h1 className="font-heading max-w-3xl text-4xl whitespace-pre-line font-medium tracking-tight text-balance @3xl:text-6xl @3xl:leading-[1.05]">
          {title}
        </h1>
        <p className="mt-6 max-w-xl text-base text-pretty text-muted-foreground @3xl:text-lg">{description}</p>
        <div className="mt-8 flex flex-wrap items-center gap-3">
          <ActionButton size="lg" action={primaryAction} />
          <ActionButton size="lg" variant="ghost" action={secondaryAction}>
            <ArrowUpRight />
          </ActionButton>
        </div>
      </div>

      <div className="relative mx-auto mt-12 w-full max-w-6xl px-4 pb-12 @3xl:mt-16 @3xl:h-152 @3xl:overflow-hidden @3xl:px-8 @3xl:pb-0">
        <div className="relative @3xl:h-full @3xl:perspective-distant">
          <div
            className={cn(
              "relative flex flex-col gap-3 @3xl:block @3xl:h-full @3xl:transform-3d",
              tiltClass[tilt]
            )}
          >
            <div className="rounded-xl border bg-card @3xl:h-full @3xl:w-4/5 @3xl:rounded-b-none @3xl:border-b-0 @3xl:mask-b-from-50% @3xl:mask-r-from-70%">
              <div className="flex items-center justify-between gap-3 p-4 @3xl:justify-start">
                <p className="truncate text-sm font-medium">{inbox.title}</p>
                <div className="flex shrink-0 gap-1.5">
                  {inbox.tabs.map((tab, index) => (
                    <Badge key={tab} variant={index === 0 ? "secondary" : "outline"}>
                      {tab}
                    </Badge>
                  ))}
                </div>
              </div>
              <Separator />
              <ul className="flex flex-col">
                {inbox.tickets.map((ticket, index) => (
                  <li
                    key={ticket.id}
                    className={cn(
                      "border-b",
                      index === 1 && "border-b-0 @3xl:border-b",
                      index < 2 ? "block" : "hidden @3xl:block",
                      ticket.selected && "bg-muted"
                    )}
                  >
                    <div className="flex items-center gap-3 px-4 py-3 @3xl:w-2/5">
                      <span className={cn("size-2 shrink-0 rounded-full", dotTone[ticket.tone])} />
                      <span className="w-24 shrink-0 truncate text-sm font-medium">{ticket.customer}</span>
                      <span className="min-w-0 flex-1 truncate text-sm text-muted-foreground">
                        {ticket.subject}
                      </span>
                      <span className="shrink-0 text-sm text-muted-foreground @3xl:hidden">{ticket.time}</span>
                    </div>
                  </li>
                ))}
              </ul>
            </div>

            <div className="rounded-xl border bg-card shadow-lg @3xl:absolute @3xl:top-28 @3xl:right-10 @3xl:w-3/5 @3xl:translate-z-16">
              <div className="flex items-center gap-3 p-4">
                <Avatar className="size-8">
                  <AvatarFallback>{reply.customer.slice(0, 1)}</AvatarFallback>
                </Avatar>
                <p className="min-w-0 flex-1 truncate text-sm font-medium">{reply.customer}</p>
                <Badge variant="secondary" className="shrink-0 gap-1.5">
                  <Sparkles className="size-3" />
                  {reply.agent}
                </Badge>
              </div>
              <Separator />
              <div className="flex flex-col gap-4 p-4">
                <p className="border-l-2 pl-3 text-sm">{reply.customerMessage}</p>
                <div>
                  <p className="text-sm text-muted-foreground">{reply.sourcesTitle}</p>
                  <ul className="mt-2 flex flex-col gap-1.5 text-sm">
                    {reply.sources.map((source) => (
                      <li key={source} className="flex items-center gap-2">
                        <Check className="size-3.5 shrink-0 text-chart-2" />
                        <span className="truncate">{source}</span>
                      </li>
                    ))}
                  </ul>
                </div>
                <p className="border-t pt-4 text-sm text-pretty">{reply.draft}</p>
                <div className="flex items-center justify-between gap-3">
                  <span className="min-w-0 text-sm text-pretty text-muted-foreground">{reply.confidence}</span>
                  <div className="flex shrink-0 gap-2">
                    <ActionButton size="sm" variant="outline" action={reply.edit} />
                    <ActionButton size="sm" action={reply.send} />
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}
```

Not inlined (2 files, 4.1 KB). Full sources: https://uifino.com/r/blocks/hero-tilted-panels.json
