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";

const shadows = ["none", "xs", "md", "lg", "xl"] as const;

export default function BoxElevationDemo() {
  return (
    <div className="flex min-h-[320px] w-full flex-wrap items-center justify-center gap-4 bg-background p-8">
      {shadows.map((s) => (
        <Box
          key={s}
          surface="base"
          padding={4}
          radius="card"
          shadow={s}
          style={{
            minWidth: 96,
            textAlign: "center",
            color: "var(--may-color-text)",
          }}
        >
          {s}
        </Box>
      ))}
    </div>
  );
}

More by adit-firdaus

View all
  • Steps

    Steps

    63
  • Popover

    Popover

    4
  • Adaptive Sheet

    Adaptive Sheet

    3
  • Notice Bar

    Notice Bar

    3
  • Label

    Label

    1
  • Adaptive Card

    Adaptive Card

  • Pagination

    Pagination

  • Kbd

    Kbd

More in Cards

View all
  • Stats cards with links

    Stats cards with links

    46
  • Course Design Cards

    Course Design Cards

    1.3K
  • Liquid Glass Card

    Liquid Glass Card

    202
  • Statistics Card 2

    Statistics Card 2

    321
  • Card Studio

    Card Studio

    37
  • Astryx Clickable Card

    Astryx Clickable Card

    1
  • Admin Dashboard Cards

    Admin Dashboard Cards

    40
  • Statistics Card 10

    Statistics Card 10

    307