GitHub Stars Button
animate-ui/components-buttons-github-starsFreeComponent
A clickable button that links to a GitHub repository and displays the number of stars.
Install it
npx shadcn@latest add https://animate-ui.com/r/components-buttons-github-stars.jsonSource
1import * as React from 'react';2import { cva, type VariantProps } from 'class-variance-authority';3import { StarIcon } from 'lucide-react';45import {6 Button as ButtonPrimitive,7 type ButtonProps as ButtonPrimitiveProps,8} from '@/components/animate-ui/primitives/buttons/button';9import {10 GithubStars,11 GithubStarsIcon,12 GithubStarsLogo,13 GithubStarsNumber,14 GithubStarsParticles,15 type GithubStarsProps,16} from '@/components/animate-ui/primitives/animate/github-stars';17import { cn } from '@/lib/utils';1819const buttonVariants = cva(20 "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-[box-shadow,_color,_background-color,_border-color,_outline-color,_text-decoration-color,_fill,_stroke] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",21 {22 variants: {23 variant: {24 default:25 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',26 accent: 'bg-accent text-accent-foreground shadow-xs hover:bg-accent/90',27 outline:28 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',29 ghost:30 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',31 },32 size: {33 default: 'h-9 px-4 py-2 has-[>svg]:px-3',34 sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',35 lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',36 },37 },38 defaultVariants: {39 variant: 'default',40 size: 'default',41 },42 },43);4445const buttonStarVariants = cva('', {46 variants: {47 variant: {48 default:49 'fill-neutral-700 stroke-neutral-700 dark:fill-neutral-300 dark:stroke-neutral-300',50 accent:51 'fill-neutral-300 stroke-neutral-300 dark:fill-neutral-700 dark:stroke-neutral-700',52 outline:53 'fill-neutral-300 stroke-neutral-300 dark:fill-neutral-700 dark:stroke-neutral-700',54 ghost:55 'fill-neutral-300 stroke-neutral-300 dark:fill-neutral-700 dark:stroke-neutral-700',56 },57 },58 defaultVariants: {59 variant: 'default',60 },61});6263type GitHubStarsButtonProps = Omit<64 ButtonPrimitiveProps & GithubStarsProps,65// … truncated
What it pulls in
npm packages
Other registry items
Files it writes
More from Animate UI
All 580 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avatar Groupcomponents-animate-avatar-group | Animate UI | Components | Free | 1 dep | |
| Codecomponents-animate-code | Animate UI | Components | Free | 1 dep | |
| Code Tabscomponents-animate-code-tabs | Animate UI | Components | Free | 1 dep | |
| Cursorcomponents-animate-cursor | Animate UI | Components | Free | no deps | |
| GitHub Stars Wheelcomponents-animate-github-stars-wheel | Animate UI | Components | Free | 1 dep | |
| Tabscomponents-animate-tabs | Animate UI | Components | Free | no deps | |
| Tooltipcomponents-animate-tooltip | Animate UI | Components | Free | 1 dep | |
| Bubble Backgroundcomponents-backgrounds-bubble | Animate UI | Components | Free | 1 dep |
