Componentpickers0.74 KB gzipZero dependencies

Size Picker

Size chip picker with out-of-stock strikes and stock dots.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add size-picker

Or install the full npm package:

npm install bigbullui

Usage

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

Source code

size-picker.tsx + 1 helper

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

tsxsize-picker.tsx80 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface SizeOption {  label: string;  available?: boolean;  stock?: number;} export interface SizePickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "value" | "defaultValue"> {  sizes: SizeOption[];  value?: string;  defaultValue?: string;  onValueChange?: (value: string) => void;  className?: string;}

Props

Interactive Prop Playground

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

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