Componentpickers0.69 KB gzipZero dependencies

Variant Picker

Color swatch and size variant picker with animated selection.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

Add to your project via CLI (zero dependencies, code you own):

npx bigbullui add variant-picker

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { VariantPicker } from "@/components/ui/variant-picker"; <VariantPicker />

Source code

variant-picker.tsx + 1 helper

Zero third-party dependencies (2 local files shown in tabs below).

tsxvariant-picker.tsx84 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface ColorOption {  name: string;  className?: string;} export interface VariantPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "value" | "defaultValue"> {  colors: ColorOption[];  sizes?: string[];  value?: string;  defaultValue?: string;  onColorChange?: (name: string) => void;  onSizeChange?: (size: string) => void;  className?: string;

Props

Interactive Prop Playground

Tweak parsed AST props below to generate ready-to-paste JSX.

tsx3 lines
import { VariantPicker } from "@/components/ui/variant-picker"; <VariantPicker />
PropTypeDescription
colorsColorOption[]Configures colors. (Default: [])
sizesstring[]Configures sizes.
valuestringControlled value.
defaultValuestringInitial value when uncontrolled.
onColorChange(name: string) => voidCallback invoked on color change.
onSizeChange(size: string) => voidCallback invoked on size change.
classNamestringOptional Tailwind or custom CSS classes merged with component styles.