Feature card
An icon, title, description, optional badge and call to action, vertical or horizontal.
Preview
Lifts on hover with a spring. With reduced motion turned on, it renders the plain layout.
Copy and paste
NewInstall with one command, then edit the code like any other file in your project.
Copy and paste
NewInstall with one command, then edit the code like any other file in your project.
Installation
Run this in a project that already uses shadcn/ui. It adds the component and anything it needs; the motion version also adds the plain one and the motion package.
Usage
import { FeatureCard } from "@/components/custom/feature-card";
<FeatureCard
title="Copy and paste"
description="Install with one command, then edit the code."
icon={Copy}
badge="New"
ctaText="Learn more"
orientation="vertical"
/>import { FeatureCardMotion } from "@/components/custom/feature-card/feature-card-motion";
<FeatureCardMotion {...props} />Props
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | Feature name. |
| description* (required) | string | – | One or two sentences. |
| icon* (required) | LucideIcon | – | Icon component. |
| iconColor | string | "text-primary" | Tailwind classes for the icon color. |
| iconBg | string | "bg-primary/10" | Tailwind classes for the icon tile. |
| badge | string | – | Optional badge text. |
| badgeVariant | "default" | "secondary" | "destructive" | "outline" | "secondary" | Badge style. |
| ctaText | string | – | Button text; no button when omitted. |
| onCtaClick | () => void | – | Called when the button is clicked. Needs a client component parent. |
| orientation | "vertical" | "horizontal" | "vertical" | Icon above or beside the text. |
| hoverEffect | boolean | true | Lift the card on hover. |
| ...props | React.ComponentProps<"div"> | – | Any other div attribute (id, aria-*, data-*, ref) goes to the root element. |
| Prop | Type | Default | Description |
|---|---|---|---|
| title* (required) | string | – | Feature name. |
| description* (required) | string | – | One or two sentences. |
| icon* (required) | LucideIcon | – | Icon component. |
| iconColor | string | "text-primary" | Tailwind classes for the icon color. |
| iconBg | string | "bg-primary/10" | Tailwind classes for the icon tile. |
| badge | string | – | Optional badge text. |
| badgeVariant | "default" | "secondary" | "destructive" | "outline" | "secondary" | Badge style. |
| ctaText | string | – | Button text; no button when omitted. |
| onCtaClick | () => void | – | Called when the button is clicked. Needs a client component parent. |
| orientation | "vertical" | "horizontal" | "vertical" | Icon above or beside the text. |
| hoverEffect | boolean | true | Lift the card on hover. |
| ...props | React.ComponentProps<"div"> | – | Any other div attribute (id, aria-*, data-*, ref) goes to the root element. |
Accessibility
- The icon is decorative and hidden from screen readers.
- The motion version follows the visitor's reduced-motion setting and never hides content before it animates.