Skip to content

Instantly share code, notes, and snippets.

@srph
Last active July 22, 2026 18:38
Show Gist options
  • Select an option

  • Save srph/f9ca311b27af71d556b4b35e4680e792 to your computer and use it in GitHub Desktop.

Select an option

Save srph/f9ca311b27af71d556b4b35e4680e792 to your computer and use it in GitHub Desktop.
layer-card - modern duo-tone cards
import type { HTMLAttributes } from "react";
import { cn } from "@/lib/cn";
// Example: <LayerCard><LayerCardSecondary>Title</LayerCardSecondary><LayerCardContent>Content</LayerCardContent></LayerCard>
export function LayerCard({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
return (
<div
className={cn(
"rounded-lg border border-neutral-200 bg-neutral-100",
className,
)}
{...props}
/>
);
}
// Super useful as heading or footer
export function LayerCardSecondary({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
return <div className={cn("p-2", className)} {...props} />;
}
export function LayerCardContent({ className, ...props }: HTMLAttributes<HTMLDivElement>) {
return <div className={cn("bg-white rounded-lg p-2", className)} {...props} />;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment