-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(libs/docs): add accordion stories
- Loading branch information
1 parent
ab4ddee
commit 5e615c0
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { Accordion, Accordions } from 'fumadocs-ui/components/accordion' | ||
|
||
const meta: Meta<typeof Accordion> = { | ||
title: '📚 Docs Site/Accordion', | ||
component: Accordion, | ||
tags: ['autodocs'], | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
argTypes: { | ||
title: { | ||
control: 'text', | ||
description: 'The title of the accordion', | ||
}, | ||
asChild: { | ||
control: 'boolean', | ||
description: 'Renders the component as a child element', | ||
}, | ||
disabled: { | ||
control: 'boolean', | ||
description: 'Disables the accordion', | ||
defaultValue: false, | ||
}, | ||
}, | ||
} | ||
|
||
export default meta | ||
|
||
type Story = StoryObj<typeof Accordion> | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: 'What is Fumadocs?', | ||
asChild: false, | ||
disabled: false, | ||
}, | ||
render: args => ( | ||
<Accordions> | ||
<Accordion {...args}>Fumadocs is a documentation UI toolkit.</Accordion> | ||
<Accordion title="What do we love?" {...args}> | ||
We love clean and efficient documentation! | ||
</Accordion> | ||
</Accordions> | ||
), | ||
} | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
title: 'What is Fumadocs?', | ||
asChild: false, | ||
disabled: true, | ||
}, | ||
render: args => ( | ||
<Accordions> | ||
<Accordion {...args}>This accordion is disabled.</Accordion> | ||
</Accordions> | ||
), | ||
} | ||
|
||
export const Multiple: Story = { | ||
args: { | ||
title: 'What is Fumadocs?', | ||
asChild: false, | ||
disabled: false, | ||
}, | ||
render: args => ( | ||
<Accordions type="multiple"> | ||
<Accordion {...args}>Fumadocs is a documentation UI toolkit.</Accordion> | ||
<Accordion title="What do we love?" {...args}> | ||
We love clean and efficient documentation! | ||
</Accordion> | ||
</Accordions> | ||
), | ||
} |