Featured Icon
shadcncraft/featured-iconFreeComponent
A component that places an icon inside a styled square or circle frame for extra prominence. This component makes supporting visuals stand out in marketing layouts.
Live preview
live · rendered by the registry
Rendered by shadcncraft on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://shadcncraft.com/r/featured-icon.jsonSource
1import * as React from "react";2import { cva, type VariantProps } from "class-variance-authority";34import { cn } from "@/lib/utils";56export const featuredIconVariants = cva(7 "flex shrink-0 items-center justify-center border bg-muted [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-primary",8 {9 variants: {10 size: {11 sm: "size-8 rounded-sm [&_svg]:size-3",12 md: "size-12 rounded-md [&_svg]:size-4",13 lg: "size-16 rounded-lg [&_svg]:size-6",14 },15 },16 defaultVariants: {17 size: "md",18 },19 }20);2122export function FeaturedIcon({23 size = "md",24 className,25 ...props26}: React.ComponentProps<"div"> & VariantProps<typeof featuredIconVariants>) {27 return (28 <div29 data-slot="featured-icon"30 className={cn(featuredIconVariants({ size }), className)}31 {...props}32 />33 );34}
Files it writes
More from shadcncraft
All 26 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avatar Stackavatar-stack | shadcncraft | Components | Free | no deps | |
| Badgebadge | shadcncraft | Components | Free | no deps | |
| Image Zoomimage-zoom | shadcncraft | Components | Free | 1 dep | |
| Marqueemarquee | shadcncraft | Components | Free | no deps | |
| Page Headingpage-heading | shadcncraft | Components | Free | no deps | |
| Placeholder Logoplaceholder-logo | shadcncraft | Components | Free | no deps | |
| Profile Cardprofile-card | shadcncraft | Components | Free | no deps | |
| Section Headingsection-heading | shadcncraft | Components | Free | no deps |
