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-uiand also paste code maunallyFor both React & Next Js“
1. Variants
These define the intent and visual weight of the Select.
Preview
2. Sizes
Selects can be scaled to fit different UI densities.
Preview
3. Example
Made an example for better understanding in which you an select Country
Important Note “I have used
tailwindcssyou can use normalCSSfor text color”
Preview
Selected:
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | undefined | Label text displayed above the select input. |
value | string | number | undefined | Currently selected value. |
onChange | (value: string | number) => void | undefined | Callback function triggered when the selected value changes. |
options | Array<{ label: string, value: string | number }> | [] | Array of options for the dropdown. Each option should have label and value. |
placeholder | string | " " | 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. |
color | string | "#000" | Text color or main color for the select input. |
error | boolean | false | Displays the select in an error state if true. |
disabled | boolean | false | Disables the select input if true. |
className | string | "" | Custom CSS classes for additional styling. |
...props | React.SelectHTMLAttributes<HTMLSelectElement> | - | Additional props passed to the <select> element. |
Installation
You can
Integrate Zure UIBy 2 waysnpm install zure-uiOr byManually creating folder, files & paste the given code ItTotally depends on your workflow.
NPM
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-appStep 2: Navigate to Your Project Directory
After creating your project, navigate to your project directory:
cd my-appStep 3: Install the Package
Run the following command in your project root to add the library as a dependency.
npm install zure-uiStep 4: Start Building
You can now import any component directly into your React files.
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>
}