Componentpickers0.74 KB gzipZero dependencies
Size Picker
Size chip picker with out-of-stock strikes and stock dots.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add size-pickerOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { SizePicker } from "@/components/ui/size-picker"; <SizePicker />Source code
size-picker.tsx + 1 helperZero 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 />| Prop | Type | Description |
|---|---|---|
| sizes | SizeOption[] | Configures sizes. (Default: []) |
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. |
| onValueChange | (value: string) => void | Callback invoked on value change. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |