diff --git a/packages/react/src/docs/components/Checkbox.mdx b/packages/react/src/docs/components/Checkbox.mdx new file mode 100644 index 0000000..2842fa2 --- /dev/null +++ b/packages/react/src/docs/components/Checkbox.mdx @@ -0,0 +1,131 @@ +import { Button } from "@components/Button"; +import { Label } from "@components/Label"; +import { Checkbox } from "@components/Checkbox"; +import { TabProvider, TabTrigger, TabContent, TabList } from "@components/Tabs"; +import { Story } from "@/components/Story"; +import { LoadedCode } from "@/components/LoadedCode"; + +# Checkbox +A control that allows the user to toggle between checked and not checked. + + + + Preview + Code + + + + + + Checkbox + + + + + ```tsx + import { Label } from "@components/Label"; + import { Checkbox } from "@components/Checkbox"; + + export function CheckboxExample() { + return ( + + + Checkbox + + ); + } + ``` + + + +## Installation + +1. Create a new file `Checkbox.mdx` in your component folder. +2. Copy and paste the following code into the file. + + + +## Usage + +```tsx +import { Checkbox } from "@components/Checkbox"; +``` + +```html + +``` + +### Props + +#### Variants + +| Prop | Type | Default | Description | +| :---- | :---- | :------- | :----------- | +| `size` | `"base" \| "md" \| "lg"` | `"md"` | The size of the checkbox | + +## Examples + +### Text + + + + Preview + Code + + + + + + Agree terms and conditions + + + + + ```tsx + import { Label } from "@components/Label"; + import { Checkbox } from "@components/Checkbox"; + + export function CheckboxExample() { + return ( + + + Agree terms and conditions + + ); + } + ``` + + + +### Disabled + + + + Preview + Code + + + + + + Agree terms and conditions + + + + + ```tsx + import { Label } from "@components/Label"; + import { Checkbox } from "@components/Checkbox"; + + export function CheckboxExample() { + return ( + + + Agree terms and conditions + + ); + } + ``` + + +
Agree terms and conditions