BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/dashboardblocks/icon

Icon

dashboardblocks/icon
FreeComponent

An icon component.

Live preview

live · rendered by the registry
Rendered by dashboardblocks on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://dashboardblocks.com/r/icon.json

Source

registry/components/dashboardblocks/icon.tsxdashboardblocks.com/r/icon.json
1import { type VariantProps, cva } from 'class-variance-authority'
2import { type LucideIcon } from 'lucide-react'
3
4import { cn } from '@/lib/utils'
5
6const iconVariants = cva('flex items-center justify-center bg-muted aspect-square', {
7 variants: {
8 variant: {
9 default: 'bg-primary text-primary-foreground hover:bg-primary/90',
10 destructive:
11 'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
12 outline:
13 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
14 secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
15 ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
16 link: 'text-primary underline-offset-4 hover:underline',
17 },
18 shape: {
19 square: 'rounded-md',
20 circle: 'rounded-full',
21 },
22 size: {
23 default: 'size-12 p-3',
24 sm: 'size-8 p-2',
25 md: 'size-10 p-2.5',
26 },
27 },
28 defaultVariants: {
29 variant: 'default',
30 shape: 'square',
31 size: 'default',
32 },
33})
34
35interface IconProps extends VariantProps<typeof iconVariants> {
36 className?: string
37 icon: LucideIcon
38}
39
40function Icon({
41 className,
42 variant = 'default',
43 icon: IconComponent,
44 shape = 'square',
45 size,
46}: IconProps) {
47 return (
48 <div className={cn(iconVariants({ variant, shape, size }), className)}>
49 <IconComponent />
50 </div>
51 )
52}
53
54type SVGProps = React.HTMLAttributes<SVGElement>
55
56const Icons = {
57 github: (props: SVGProps) => (
58 <svg viewBox='0 0 438.549 438.549' {...props}>
59 <path
60 fill='#1f2328'
61// … truncated

What it pulls in

npm packages

  • class-variance-authority
  • lucide-react

Files it writes

  • registry/components/dashboardblocks/icon.tsx

Facts

Registry
dashboardblocks
Type
registry:component
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-01
Last confirmed
yesterday

Go to the source

Docs on dashboardblocks dashboardblocks.com LGLabGreg/dashboardblocks on GitHub Raw registry item This item as JSON

More from dashboardblocks

All 36 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Activity Feedactivity-feeddashboardblocksComponentsFree1 dep
activity-feed-01activity-feed-01dashboardblocksComponentsFree1 dep
activity-feed-02activity-feed-02dashboardblocksComponentsFree1 dep
activity-feed-03activity-feed-03dashboardblocksComponentsFree1 dep
activity-feed-04activity-feed-04dashboardblocksComponentsFree1 dep
activity-feed-05activity-feed-05dashboardblocksComponentsFree1 dep
Animated Numberanimated-numberdashboardblocksComponentsFreeno deps
Animated Waveanimated-wavedashboardblocksComponentsFreeno deps
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex