Skip to content

Commit

Permalink
Create card storybook (#46)
Browse files Browse the repository at this point in the history
Co-authored-by: anvuvuong <[email protected]>
  • Loading branch information
um1chc5 and anvuvuong authored May 7, 2024
1 parent 07edd2e commit 2b9e18b
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions packages/ui/src/stories/card.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Meta, StoryObj } from '@storybook/react';
import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from '../card';
import { Label } from '../label';
import { Input } from '../input';
import { Button } from '../button';

function CardDemo() {
return (
<Card className='w-[360px]'>
<CardHeader className='text-center'>
<CardTitle className='text-3xl font-bold'>Login</CardTitle>
<CardDescription>Enter credentials to access your account.</CardDescription>
</CardHeader>
<CardContent>
<form>
<div className='mb-2 flex flex-col gap-2'>
<Label>Username or email</Label>
<Input className='rounded shadow-sm focus-visible:ring-0 focus-visible:ring-offset-0' />
</div>
<div className='mb-2 flex flex-col gap-2'>
<Label>Password</Label>
<Input className='rounded shadow-sm focus-visible:ring-0 focus-visible:ring-offset-0' />
</div>
<a
href='/'
className='text-muted-foreground text-sm'
>
Forgot password?
</a>
</form>
</CardContent>
<CardFooter className='flex-col gap-2'>
<Button className='w-full'>Submit</Button>
<Button
className='w-full'
variant='secondary'
>
Sign Up
</Button>
</CardFooter>
</Card>
);
}

const meta = {
title: 'Coderum/Card',
component: CardDemo,
parameters: {
layout: 'centered',
},
} satisfies Meta<typeof CardDemo>;

export default meta;
type Story = StoryObj<typeof meta>;

export const CardExample: Story = {};

0 comments on commit 2b9e18b

Please sign in to comment.