Componentpickers1.04 KB gzipZero dependencies
Country Select
Country select with flag emojis and codes.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add country-selectOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CountrySelect } from "@/components/ui/country-select"; <CountrySelect />Source code
country-select.tsx + 2 helpersZero third-party dependencies (3 local files shown in tabs below).
tsxcountry-select.tsx90 lines
"use client"; import * as React from "react";import { registerEscapeLayer } from "./lib/focus-trap";import { cn } from "./lib/utils"; export interface CountryOption { code: string; name: string; flag: string;} export const COUNTRIES: CountryOption[] = [ { code: "TR", name: "Turkey", flag: "🇹🇷" }, { code: "US", name: "United States", flag: "🇺🇸" }, { code: "GB", name: "United Kingdom", flag: "🇬🇧" }, { code: "DE", name: "Germany", flag: "🇩🇪" }, { code: "FR", name: "France", flag: "🇫🇷" },Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { COUNTRIES } from "@/components/ui/country-select"; <COUNTRIES />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. |
| onValueChange | (code: string) => void | Callback invoked on value change. |