Componentpickers1.04 KB gzipZero dependencies

Country Select

Country select with flag emojis and codes.

Preview

Live Preview
Open ↗

Installation

Tokens guide →

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

npx bigbullui add country-select

Or install the full npm package:

npm install bigbullui

Usage

tsx3 lines
import { CountrySelect } from "@/components/ui/country-select"; <CountrySelect />

Source code

country-select.tsx + 2 helpers

Zero 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 />
PropTypeDescription
valuestringControlled value.
defaultValuestringInitial value when uncontrolled.
onValueChange(code: string) => voidCallback invoked on value change.