File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
src/stories/common/dropdown Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ import { Meta , StoryObj } from '@storybook/react'
2+
3+ import { Dropdown } from '@/components/common/dropdown'
4+
5+ export default {
6+ title : 'Common/Dropdown/Dropdown' ,
7+ component : Dropdown ,
8+ parameters : {
9+ layout : 'centered' ,
10+ } ,
11+ } as Meta
12+
13+ export const Default : StoryObj = {
14+ render : ( ) => (
15+ < Dropdown className = 'w-64' >
16+ < Dropdown . Trigger className = 'w-full rounded-md bg-gray-200 px-4 py-2' >
17+ Select an option
18+ </ Dropdown . Trigger >
19+ < Dropdown . Menu position = 'dropdown' alignment = 'left' >
20+ < Dropdown . Item value = 'option1' > Option 1</ Dropdown . Item >
21+ < Dropdown . Item value = 'option2' > Option 2</ Dropdown . Item >
22+ < Dropdown . Item value = 'option3' closeOnSelect = { false } >
23+ Option 3 (Persistent)
24+ </ Dropdown . Item >
25+ </ Dropdown . Menu >
26+ </ Dropdown >
27+ ) ,
28+ }
29+
30+ export const Dropup : StoryObj = {
31+ render : ( ) => (
32+ < Dropdown className = 'w-64' >
33+ < Dropdown . Trigger className = 'w-full rounded-md bg-gray-200 px-4 py-2' >
34+ Select an option
35+ </ Dropdown . Trigger >
36+ < Dropdown . Menu position = 'dropup' alignment = 'right' >
37+ < Dropdown . Item value = 'option1' > Option 1</ Dropdown . Item >
38+ < Dropdown . Item value = 'option2' > Option 2</ Dropdown . Item >
39+ < Dropdown . Item value = 'option3' closeOnSelect = { false } >
40+ Option 3 (Persistent)
41+ </ Dropdown . Item >
42+ </ Dropdown . Menu >
43+ </ Dropdown >
44+ ) ,
45+ }
You can’t perform that action at this time.
0 commit comments