adit-firdaus

Box

Cards

About

A polymorphic layout primitive for applying iOS-style surface color, padding, border radius and elevation to any element without using borders.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Box to your project and fits it to your theme.

Code

How Box is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Box } from "@/components/ui/box";

export default function BoxDemo() {
  return (
    <div className="flex min-h-[420px] w-full items-center justify-center bg-background p-8">
      <Box
        surface="grouped"
        padding={4}
        radius="card"
        style={{ maxWidth: 360, width: "100%" }}
      >
        <Box surface="base" padding={4} radius="card">
          <div
            style={{
              fontSize: "var(--may-text-headline)",
              fontWeight: 600,
              color: "var(--may-color-text)",
            }}
          >
            Apple ID
          </div>
          <div
            style={{
              fontSize: "var(--may-text-footnote)",
              color: "var(--may-color-text-secondary)",
              marginTop: "var(--may-space-1)",
            }}
          >
            iCloud, Media &amp; Purchases
          </div>
          <Box
            surface="nested"
            padding={3}
            radius="md"
            style={{
              marginTop: "var(--may-space-3)",
              color: "var(--may-color-text-secondary)",
            }}
          >
            appleid@icloud.com
          </Box>
        </Box>
      </Box>
    </div>
  );
}

More by adit-firdaus

View all
  • Steps

    Steps

    44
  • Popover

    Popover

    3
  • Adaptive Sheet

    Adaptive Sheet

    1
  • Notice Bar

    Notice Bar

    1
  • Adaptive Card

    Adaptive Card

  • Pagination

    Pagination

  • Label

    Label

  • Kbd

    Kbd

More in Cards

View all
  • Course Design Cards

    Course Design Cards

    1.3K
  • Card

    Card

  • Photo Deck

    Photo Deck

    42
  • Statistics Card 10

    Statistics Card 10

    301
  • Approval Card

    Approval Card

    33
  • Statistics Card 2

    Statistics Card 2

    309
  • Card with Ellipsis Pattern

    Card with Ellipsis Pattern

    36
  • Statistics Card 7

    Statistics Card 7

    334