OpenHands/openhands-ui/components/checkbox/Checkbox.stories.tsx
Mislav Lukach 764077ef3d
Feat/create UI dir (#9462)
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-07-03 13:26:19 +00:00

45 lines
993 B
TypeScript

import type { Meta, StoryObj } from "@storybook/react-vite";
import { Checkbox, type CheckboxProps } from "./Checkbox";
import { useState } from "react";
const meta = {
title: "Components/Checkbox",
component: Checkbox,
parameters: {
layout: "centered",
},
tags: ["autodocs"],
} satisfies Meta<typeof Checkbox>;
export default meta;
type Story = StoryObj<typeof meta>;
const CheckboxComponent = (props: CheckboxProps) => {
const [checked, setChecked] = useState(false);
return (
<Checkbox
{...props}
checked={checked}
onChange={(e) => setChecked(e.target.checked)}
/>
);
};
export const Enabled: Story = {
args: {
label:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry",
},
render: CheckboxComponent,
};
export const Disabled: Story = {
args: {
disabled: true,
label:
"Lorem Ipsum is simply dummy text of the printing and typesetting industry",
},
render: CheckboxComponent,
};