diff --git a/apps/www/content/primitives/components/checkbox.mdx b/apps/www/content/primitives/components/checkbox.mdx
index e796ac17..baf65655 100644
--- a/apps/www/content/primitives/components/checkbox.mdx
+++ b/apps/www/content/primitives/components/checkbox.mdx
@@ -1,6 +1,6 @@
---
title: Checkbox
-description: Checkbox is a user interface control that enables users to toggle between a checked and unchecked state
+description: Checkbox is a user interface control that enables users to toggle between checked, unchecked, and indeterminate states
radix:
link: https://www.radix-ui.com/docs/primitives/components/checkbox
api: https://www.radix-ui.com/docs/primitives/components/checkbox#api-reference
@@ -10,14 +10,14 @@ radix:
-
-
+
+
+
+
@@ -29,40 +29,92 @@ Install the component from your command line.
+## Usage
+
+### Controlled Component
+You can control the checkbox state using the `checked` and `onCheckedChange` props:
+
+
+ setChecked(value)}
+/>
+`} border />
+
+
+### Indeterminate State
+The indeterminate state is useful for representing partial selection, commonly used in parent checkboxes:
+
+
+ ('indeterminate');
+
+ setChecked(value)}
+/>
+`} border />
+
+
+## Props
+
+The `Checkbox` component accepts the following props:
+
+- `checked`: The controlled state of the checkbox (`boolean | "indeterminate"`)
+- `defaultChecked`: The default state when initially rendered (`boolean | "indeterminate"`)
+- `onCheckedChange`: Event handler called when the state changes (`(checked: boolean | "indeterminate") => void`)
+- `disabled`: When true, prevents the user from interacting with the checkbox (`boolean`)
## Anatomy
Import all parts and piece them together.
-
-`} border />
-
+// Checked state
+
-## Scale
-The Checkbox component offers different size options to suit various design needs. By selecting the "Medium" size, you can create a larger Checkbox that provides enhanced visibility and ease of interaction within the user interface. Additionally, the Checkbox component also supports the following size options:
+// Indeterminate state
+
-- Small
-- Medium
+// Disabled state
+
+`} border />
+
+
+## States
+The Checkbox component supports multiple states to represent different selection conditions:
-These different size options allow you to customize the appearance of the Checkbox to match your specific design preferences and ensure a seamless user experience.
+- Unchecked: Default state
+- Checked: Selected state
+- Indeterminate: Partial selection state
+- Disabled: Disabled state
`,
+ name: "Unchecked",
+ code: ``,
+ },
+ {
+ name: "Checked",
+ code: ``,
+ },
+ {
+ name: "Indeterminate",
+ code: ``,
},
{
- name: "Medium",
- code: ``,
+ name: "Disabled",
+ code: ``,
},
-
]}
-/>
\ No newline at end of file
+/>
diff --git a/apps/www/examples/shield-ts/assets.tsx b/apps/www/examples/shield-ts/assets.tsx
index c74beff8..386cd3c3 100644
--- a/apps/www/examples/shield-ts/assets.tsx
+++ b/apps/www/examples/shield-ts/assets.tsx
@@ -2,15 +2,12 @@ import React, { useState, useCallback, useEffect } from "react";
import dayjs from "dayjs";
import { PlusIcon, BlendingModeIcon, HomeIcon, ChevronDownIcon } from "@radix-ui/react-icons";
import {
- Checkbox,
DataTable,
- Flex,
- Text,
Title,
useTable
} from "@raystack/apsara";
-import { toast, ToastContainer, Avatar, AvatarGroup, Button, Spinner, DropdownMenu, Breadcrumb } from "@raystack/apsara/v1";
+import { toast, ToastContainer, Avatar, AvatarGroup, Button, Spinner, DropdownMenu, Breadcrumb, Flex, Text, Checkbox} from "@raystack/apsara/v1";
import { getData, Payment } from "./data";
import { ApsaraColumnDef } from "@raystack/apsara/table/datatables.types";
const TOTAL_PAGES = 100;
@@ -181,6 +178,12 @@ export const Assets = () => {
const AssetsHeader = () => {
const { filteredColumns } = useTable();
+ const [checked, setChecked] = useState('indeterminate');
+ const handleCheckedChange = (newChecked: boolean | 'indeterminate') => {
+ if (newChecked !== 'indeterminate') {
+ setChecked(newChecked);
+ }
+ };
const isFiltered = filteredColumns.length > 0;
const items = [
{ label: 'Home', href: '/', icon: },
@@ -206,6 +209,15 @@ const AssetsHeader = () => {
Assets
+