Documentation menu
Getting Started
Components
Primitives
- Agent Thinking
- Alert
- Alert Dialog
- Avatar
- Badge
- Breadcrumb
- Button
- Button Group
- Calendar
- Card
- Checkbox
- Command
- Command Palette
- Context Menu
- Data Table
- Dialog
- Dropdown Menu
- Empty
- Field
- Glow Cloud
- Input
- Label
- Medication Schedule
- Period Tabs
- Popover
- Rainbow Button
- Scroll Area
- Select
- Selectable Card
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Sonner
- Spinner
- Switch
- Table
- Tabs
- Tag
- Textarea
- Timeline
- Tooltip
- Use Count Up
Charts and metrics
Patterns
- Confirm Button
- Date Picker
- Embedded
- Empty State
- Entity Drawer
- Error Boundary
- Field Row
- File Dropzone
- Form Dialog
- Kv
- List Editor
- List Page
- Live Time
- Mini Table
- Money
- Note Field
- Note Text
- Page Card
- Page Header
- Page Tabs
- Page Toolbar
- Person Cell
- Picture Field
- Print Card
- Range Switcher
- Row Actions
- Search Input
- Search Select
- Selected Box
- Signature Pad
- Status Badge
- Sub Nav Layout
- Suggest Input
- Tab Icons
- Table Footer
- Theme Accent Picker
- Time Picker
- View All Link
Dashboard cards
Advanced
Device frames
Website widgets
Website screens
Website panels
Primitives
Rainbow Button
A button with an animated rainbow edge, for the one action that should stand out.
import { Sparkles } from "lucide-react"
import { RainbowButton } from "@/registry/vcare/ui/rainbow-button"
export default function RainbowButtonDemo() {
return (
<RainbowButton>
<Sparkles className="size-4" /> Ask Brain AI
</RainbowButton>
)
}Installation
npx shadcn@latest add @vcare/rainbow-buttonOr install directly from the URL: https://ui.vcarehms.com/r/rainbow-button.json
- Install the dependencies:
npm i class-variance-authority radix-ui - Add the registry items it uses: utils.
- Copy this file into your project and change the
@/registry/vcare/…imports to your own paths.
components/ui/rainbow-button.tsx
import React from 'react';
import { Slot } from 'radix-ui';
import { cva, type VariantProps } from 'class-variance-authority';
import { cn } from '@/registry/vcare/lib/utils';
const rainbowButtonVariants = cva(
cn(
'relative cursor-pointer group transition-all animate-rainbow',
'inline-flex items-center justify-center gap-2 shrink-0',
'rounded-lg outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive',
'text-sm font-medium whitespace-nowrap',
'disabled:pointer-events-none disabled:opacity-50',
"[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
),
{
variants: {
variant: {
default:
'border-0 bg-[linear-gradient(var(--foreground),var(--foreground)),linear-gradient(var(--foreground)_50%,color-mix(in_oklab,var(--foreground)_60%,transparent)_80%,transparent),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-background [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.125rem)_solid_transparent] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)]',
outline:
'border border-input border-b-transparent bg-[linear-gradient(var(--background),var(--background)),linear-gradient(var(--background)_50%,color-mix(in_oklab,var(--foreground)_30%,transparent)_80%,transparent),linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] bg-[length:200%] text-foreground [background-clip:padding-box,border-box,border-box] [background-origin:border-box] before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,var(--color-1),var(--color-5),var(--color-3),var(--color-4),var(--color-2))] before:bg-[length:200%] before:[filter:blur(0.75rem)]',
},
size: {
default: 'h-(--control-h) px-4',
wide: 'h-(--control-h) min-w-36 px-5',
sm: 'h-8 rounded-xl px-3 text-xs',
lg: 'h-11 rounded-xl px-8',
icon: 'size-9',
},
},
defaultVariants: {
variant: 'default',
size: 'default',
},
},
);
interface RainbowButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof rainbowButtonVariants> {
asChild?: boolean;
}
const RainbowButton = React.forwardRef<HTMLButtonElement, RainbowButtonProps>(({ className, variant, size, asChild = false, ...props }, ref) => {
const Comp = asChild ? Slot.Root : 'button';
return <Comp data-slot="button" className={cn(rainbowButtonVariants({ variant, size, className }))} ref={ref} {...props} />;
});
RainbowButton.displayName = 'RainbowButton';
export { RainbowButton, rainbowButtonVariants, type RainbowButtonProps };Usage
import { RainbowButton } from "@/components/ui/rainbow-button"Exports
RainbowButton
Dependencies
class-variance-authority@^0.7.1(npm)radix-ui@^1.8.1(npm)@vcare/utils(registry)
Raw item: /r/rainbow-button.json