Checkbox
Below is the full output of the Inpu 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 Checkbox.
Preview
2. Sizes
We have provided 3 sizes sm , md & lg.
Preview
3. Example
Made an example for better understanding which showes ud the state of Checkbox.
Important Note : I have used
tailwindcssyou can use normalCSS
Preview
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Text displayed next to the checkbox. |
checked | boolean | — | Controls whether the checkbox is checked (controlled component). |
onChange | (event) => void | — | Callback fired when the checked state changes. |
size | "sm" | "md" | "lg" | "md" | Controls the size of the checkbox. |
variant | "default" | "outline" | "ghost" | "default" | Visual style variant of the checkbox. |
disabled | boolean | false | Disables the checkbox when set to true. |
error | boolean | false | Displays error state styling when true. |
color | string | "#2563eb" | Accent color of the checkbox when checked. |
className | string | "" | Additional CSS classes for custom styling. |
...props | object | — | Any extra props passed to the native checkbox input 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 {Checkbox} from "zure-ui";
export default function App() {
return (
<Checkbox defaultChecked variant="default" size="md" label="default" color="#000" />
<Checkbox defaultChecked variant="outline" size="md" label="outline" color="#000" />
<Checkbox defaultChecked variant="ghost" size="md" label="ghost" color="#000" />
);
}