Hero Ui

Card

Cards 6

About

Flexible container component for grouping related content and actions.

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

Code

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

Usage.tsx

import { Card } from "@/components/ui/heroui-card";

function Field({ label, type, placeholder }: { label: string; type: string; placeholder: string }) {
  return (
    <label className="flex flex-col gap-1 text-sm font-medium text-zinc-950 dark:text-zinc-50">
      {label}
      <input
        className="h-10 rounded-xl border border-zinc-200 bg-zinc-50 px-3 text-sm outline-none transition-colors placeholder:text-zinc-400 focus:border-blue-500 dark:border-white/10 dark:bg-white/5 dark:placeholder:text-zinc-500"
        placeholder={placeholder}
        type={type}
      />
    </label>
  );
}

export default function CardWithFormDemo() {
  return (
    <div className="flex min-h-screen w-full items-center justify-center overflow-hidden bg-background p-8">
      <Card className="w-full max-w-md">
        <Card.Header>
          <Card.Title>Login</Card.Title>
          <Card.Description>Enter your credentials to access your account</Card.Description>
        </Card.Header>
        <form>
          <Card.Content>
            <div className="flex flex-col gap-4">
              <Field label="Email" placeholder="email@example.com" type="email" />
              <Field label="Password" placeholder="••••••••" type="password" />
            </div>
          </Card.Content>
          <Card.Footer className="mt-4 flex flex-col gap-2">
            <button className="w-full rounded-full bg-zinc-950 px-4 py-2 text-sm font-medium text-white dark:bg-white dark:text-zinc-950" type="submit">
              Sign In
            </button>
            <a className="text-center text-sm font-medium text-blue-600 dark:text-blue-400" href="#">
              Forgot password?
            </a>
          </Card.Footer>
        </form>
      </Card>
    </div>
  );
}

export { CardWithFormDemo };

More by Hero Ui

View all
  • DatePicker

    DatePicker

    465
  • Chip

    Chip

    440
  •  The Pagination

    The Pagination

    361
  • HeroUI Color Picker

    HeroUI Color Picker

    105
  • Skeleton

    Skeleton

    104
  • HeroUI Table

    HeroUI Table

    100
  • HeroUI Disclosure Group

    HeroUI Disclosure Group

    94
  • HeroUI AlertDialog

    HeroUI AlertDialog

    80

More in Cards

View all
  • Stats cards with links

    Stats cards with links

    33
  • Course Design Cards

    Course Design Cards

    1.1K
  • Card

    Card

    70
  • Statistics Card 2

    Statistics Card 2

    264
  • Statistics Card 10

    Statistics Card 10

    263
  • Card

    Card

    17
  • Card Studio

    Card Studio

    9
  • The Item one

    The Item one

    3