Socket
Socket
Sign inDemoInstall

shadcn-country-region-select

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    shadcn-country-region-select

Shadcn Country & Region Select is a select input component built as part of the Shadcn design system. It offers a blend of customization and out-of-the-box styling, adhering to Shadcn's sleek and modern design principles.


Version published
Maintainers
1
Install size
1.76 MB
Created

Readme

Source

Shadcn country region select

Shadcn Country & Region Select is a select input component built as part of the Shadcn design system. It offers a blend of customization and out-of-the-box styling, adhering to Shadcn's sleek and modern design principles.

Why

I needed a country - region select component for a project. I looked around for any country - region select components that used Shadcn's design system, but I couldn't find any. So, I decided to make one myself. I hope you find it useful!

[!WARNING] Before you dive in, just double-check that you're using installing the shadcn correctly!

Usage

import { useState } from "react"
import { CountrySelect, RegionSelect } from "shadcn-country-region-select";

function App() {
  const [countryCode, setCountryCode] = useState("");

  return (
    <div className="flex items-center flex-col w-full mt-20">
      <CountrySelect
        classname="w-[180px]"
        onChange={(value) => setCountryCode(value)}
        priorityOptions={["US"]}
        placeholder="Country"
      ></CountrySelect>
      <RegionSelect
        onChange={(value) => console.log(value)}
        classname="w-[180px] mt-2"
        countryCode={countryCode}
      ></RegionSelect>
    </div>
CountrySelect properties
PropTypeDescription
classnameobjectconfiguration object for the manifest
onChangefunccallback function fired when the select value changed
placeholderstringplaceholder value, default "Country"
priorityOptionsstring[]Array of countries prioritized in the select list
whiteListstring[]Array of allowed countries
blackListstring[]Array of banned countries
RegionSelect properties
PropTypeDescription
classnamestringaccept a class string
onChangefunccallback function fired when the select value changed
placeholderstringplaceholder value, default "Region"
priorityOptionsstring[]Array of regions prioritized in the select list
whiteListstring[]Array of allowed regions
blackListstring[]Array of banned regions

Keywords

FAQs

Last updated on 23 Apr 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc