Thin light and dark rings give the card a soft, pressed edge. Use it for a contact card or a price box.
How to use
Make two files in your project's components folder: layered-card.tsx and layered-card.module.css.
Paste the code into each one, keeping the licence note at the top of the component.
It needs nothing beyond React. Your project needs CSS Modules, which Next.js and Vite already have.
Import it where you want it, then change the words, colours and sizes to yours.
The code
import * as React from "react";
import styles from "./layered-card.module.css";
type LayeredCardProps = React.HTMLAttributes<HTMLDivElement> & {
children?: React.ReactNode;
/** Outer corner radius in px. Each ring inside is 1px tighter. */
radius?: number;
};
/**
* A card built from five thin rings, light and dark in turn, so its edge reads like a pressed,
* slightly raised surface. Put the parts below inside it.
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.
import * as React from "react";
import styles from "./layered-card.module.css";
type LayeredCardProps = React.HTMLAttributes<HTMLDivElement> & {
children?: React.ReactNode;
/** Outer corner radius in px. Each ring inside is 1px tighter. */
radius?: number;
};
/**
* A card built from five thin rings, light and dark in turn, so its edge reads like a pressed,
* slightly raised surface. Put the parts below inside it.
This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.