Simple Card

Lightweight card with an 8px inset: the kit Card with a shadow and faint ring. Pair it with a BevelFrame preview and the stock card header, title, description and footer.

Open the preview in a new tab

The source comes with full access.

One payment of $149 opens the source right here and lets the CLI install every paid component, with lifetime updates.

Installation

pnpm dlx shadcn add @01orbital/simple-card
npx shadcn add @01orbital/simple-card
yarn shadcn add @01orbital/simple-card
bunx --bun shadcn add @01orbital/simple-card

Part of the 01orbital library. With a license, put ORBITAL_TOKEN in .env.local and the same command installs it (licensed install, pricing).

It lands at components/card/simple-card.tsx, as source you own and edit.

The example also uses bevel-frame, button and color-field-wash. Install them too:

pnpm dlx shadcn add @01orbital/bevel-frame @01orbital/button @01orbital/color-field-wash
npx shadcn add @01orbital/bevel-frame @01orbital/button @01orbital/color-field-wash
yarn shadcn add @01orbital/bevel-frame @01orbital/button @01orbital/color-field-wash
bunx --bun shadcn add @01orbital/bevel-frame @01orbital/button @01orbital/color-field-wash

Usage

"use client"

import { useState } from "react"

import { BevelFrame } from "@/components/card/bevel-frame"
import { SimpleCard } from "@/components/card/simple-card"
import { ColorFieldWash } from "@/components/scene/color-field-wash"
import { Button } from "@/components/ui/button"
import {
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@/components/ui/card"

// Every word on the page. Change copy here, not in the markup.
const COPY = {
  title: "A frame for your work.",
  body: "An inset preview, a short introduction, and an action when you need one.",
  cta: "Change palette",
  title2: "Another perspective.",
  body2:
    "A second palette in the same frame, with room for the work to speak for itself.",
} as const

const PALETTES = ["navy", "descent", "ember"] as const

export default function SimpleCardDemo() {
  const [palette, setPalette] = useState(0)

  return (
    <div className="grid w-full max-w-4xl place-items-center gap-6 p-6 sm:grid-cols-2">
      <SimpleCard className="surface-cardstock surface-depth [--cardstock-color:var(--card)] not-dark:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--foreground)_10%,transparent),inset_0_1px_0_color-mix(in_oklab,var(--foreground)_12%,transparent),0_4px_12px_-6px_color-mix(in_oklab,var(--scene)_14%,transparent)]! dark:[--card:oklch(0.22_0.008_260)]">
        <BevelFrame className="h-64" aria-hidden="true">
          <ColorFieldWash palette={PALETTES[palette]} blur={[20, 22]} />
        </BevelFrame>
        <CardHeader className="@container-normal gap-2 p-6">
          <CardTitle role="heading" aria-level={3}>
            {COPY.title}
          </CardTitle>
          <CardDescription className="text-foreground/70">
            {COPY.body}
          </CardDescription>
        </CardHeader>
        <CardFooter className="mt-auto px-6 pb-6">
          <Button
            onClick={() => setPalette((value) => (value + 1) % PALETTES.length)}
          >
            {COPY.cta}
          </Button>
        </CardFooter>
      </SimpleCard>
      <SimpleCard className="surface-cardstock surface-depth [--cardstock-color:var(--card)] not-dark:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--foreground)_10%,transparent),inset_0_1px_0_color-mix(in_oklab,var(--foreground)_12%,transparent),0_4px_12px_-6px_color-mix(in_oklab,var(--scene)_14%,transparent)]! dark:[--card:oklch(0.22_0.008_260)]">
        <BevelFrame className="h-64" aria-hidden="true">
          <ColorFieldWash palette="descent" blur={[20, 22]} />
        </BevelFrame>
        <CardHeader className="@container-normal gap-2 p-6">
          <CardTitle role="heading" aria-level={3}>
            {COPY.title2}
          </CardTitle>
          <CardDescription className="text-foreground/70">
            {COPY.body2}
          </CardDescription>
        </CardHeader>
      </SimpleCard>
    </div>
  )
}

API reference

Prop

Type

It also accepts the HTML attributes of the element it renders.

Dependencies

npm: cn. The CLI installs them for you.

Registry pieces it installs with it:

On this page