Skip to Content

Select

Below is the full output of the Select component across all variants and sizes.

“Its Important to install the packages & Dependencies to use can intall using npm install zure-ui and also paste code maunally For both React & Next Js

1. Variants

These define the intent and visual weight of the Select.

2. Sizes

Selects can be scaled to fit different UI densities.

3. Example

Made an example for better understanding in which you an select Country

Important Note “I have used tailwindcss you can use normal CSS for text color”

Selected:


Props

PropTypeDefaultDescription
labelstringundefinedLabel text displayed above the select input.
valuestring | numberundefinedCurrently selected value.
onChange(value: string | number) => voidundefinedCallback function triggered when the selected value changes.
optionsArray<{ label: string, value: string | number }>[]Array of options for the dropdown. Each option should have label and value.
placeholderstring" "Placeholder text shown when no value is selected.
variant'default' | 'outlined' | 'filled'"default"Visual style of the select input.
size'sm' | 'md' | 'lg'"md"Size of the select input.
colorstring"#000"Text color or main color for the select input.
errorbooleanfalseDisplays the select in an error state if true.
disabledbooleanfalseDisables the select input if true.
classNamestring""Custom CSS classes for additional styling.
...propsReact.SelectHTMLAttributes<HTMLSelectElement>-Additional props passed to the <select> element.

Installation

You can Integrate Zure UI By 2 ways npm install zure-ui Or by Manually creating folder , files & paste the given code It Totally depends on your workflow.

NPM

Step 1: Create a React App

Open your terminal and run the following command to create a new React app:

npx create-react-app my-app

Step 2: Navigate to Your Project Directory

After creating your project, navigate to your project directory:

cd my-app

Step 3: Install the Package

Run the following command in your project root to add the library as a dependency.

npm install zure-ui

Step 4: Start Building

You can now import any component directly into your React files.

Select.jsx
import { Select } from 'zure-ui'; function App() { return <Select label="Country" options={[{ label: "India", value: "in" },{ label: "USA", value: "us" },]} color="#000" variant="primary">Primary</Select> }

Last updated on