Last active
July 22, 2026 18:38
-
-
Save srph/f9ca311b27af71d556b4b35e4680e792 to your computer and use it in GitHub Desktop.
layer-card - modern duo-tone cards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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