Stars installation

You can install it in the same way you would install main components. You can copy the shadcn cli command or copy the component directly.


If you choose to install it via shadcn cli command, you'll have to choose desired package manager.


Component Props

NameDescriptionType
colorStar colorstring
sizeWidth and height of star in pixelsnumber
strokePath stroke colorstring
strokeWidthStroke widthnumber
pathClassNamePath classnamestring

If color prop isn't present fallback value will be currentColor.


Rest of the props are extended from <React.SVGProps> (basically all attributes an svg can have, such as className, width, height, aria attributes etc.).


Usage

Default

<Star1 color="red" size={200} />

With stroke

<Star1 color="red" size={200} stroke="black" strokeWidth={2} />

Custom width and height

<Star1 color="red" width={180} height={210} stroke="black" strokeWidth={2} />

Dark mode color

<Star1 className="text-red-500 dark:text-blue-500" size={200} stroke="black" strokeWidth={2} />

Dark mode stroke color

<Star1 className="text-red-500 dark:text-blue-500" pathClassName="stroke-black dark:stroke-white" size={200} strokeWidth={2} />
Edit this page