Skip to content

Commit

Permalink
feat: (#51) add label story (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
ynguyen2k2 committed May 13, 2024
1 parent f557931 commit 9892d15
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions packages/ui/src/stories/label.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { fn } from '@storybook/test';

import { Label } from '../label';
import { Checkbox } from '../checkbox';
import { Meta, StoryObj } from '@storybook/react';
function LabelDemo() {
return (
<div>
<div className='flex items-center space-x-2'>
<Checkbox id='terms' />
<Label htmlFor='terms'>Accept terms and conditions</Label>
</div>
</div>
);
}

const meta = {
title: 'CODERUM/Label',
component: LabelDemo,
parameters: {
// Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout
layout: 'centered',
},
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
tags: ['autodocs'],

// Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
args: { onClick: fn() },
} satisfies Meta<typeof LabelDemo>;
export default meta;
type Story = StoryObj<typeof meta>;

export const LabelExample: Story = {
args: {
htmlFor: 'terms',
},
};

0 comments on commit 9892d15

Please sign in to comment.