Componentpickers1.07 KB gzipZero dependencies
MonthPicker
12-month grid for selecting a month with year navigation
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add month-pickerOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { MonthPicker } from "@/components/ui/month-picker"; <MonthPicker defaultValue={new Date().getMonth()} onValueChange={(v) => {}} />Source code
month-picker.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxmonth-picker.tsx130 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface MonthPickerProps extends Omit<React.HTMLAttributes<HTMLElement>, "value" | "defaultValue"> { value?: number; // 0-11 defaultValue?: number; onValueChange?: (value: number) => void; year?: number; onYearChange?: (year: number) => void; className?: string;} const MONTHS = [ "JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER",];Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { MonthPicker } from "@/components/ui/month-picker"; <MonthPicker />| Prop | Type | Description |
|---|---|---|
| value | number | Controlled value. |
| defaultValue | number | Initial value when uncontrolled. |
| onValueChange | (value: number) => void | Callback invoked on value change. |
| year | number | Configures year. |
| onYearChange | (year: number) => void | Callback invoked on year change. |
| className | string | Optional Tailwind or custom CSS classes merged with component styles. |