diff --git a/src/components/Dropdown/Dropdown.stories.mdx b/src/components/Dropdown/Dropdown.stories.mdx new file mode 100644 index 0000000..a883012 --- /dev/null +++ b/src/components/Dropdown/Dropdown.stories.mdx @@ -0,0 +1,93 @@ +import { Meta, Canvas, Story } from '@storybook/addon-docs'; +import Dropdown from '.'; +import { colorGuide } from '@primitives'; + + + +# Dropdown + +Dropdown component is used when the users wants to select one or more items from a set of options. + +## Usage + +#### 1. Dropdown with label + +export const DropdownWithLabel = (args) => { + return ( + + ); +}; + + + + {DropdownWithLabel.bind()} + + + +#### 2. Dropdown without label + +export const DropdownWithoutLabel = (args) => { + return ( + + ); +}; + + + + {DropdownWithoutLabel.bind()} + + + +## Props + +
+ +| prop | description | type | +| -------------- | --------------------------------- | ---------- | +| `label` | label of dropdown | `string` | +| `colorConfig` | dropdown color config | `object` | +| `colorMode` | dark or light | `string` | +| `onClick` | onClick event handler | `function` | + +
+ +**colorConfig** + +colorConfig prop object support four color configurations namely: `border`, `text`, & `chevron`. + +
+ +| property | description | type | +| --------------- | ------------------------- | -------- | +| `border` | border color | `string` | +| `text` | text color | `string` | +| `chevron` | chevron color | `string` | + +
\ No newline at end of file diff --git a/src/components/Dropdown/types.ts b/src/components/Dropdown/types.ts index 50ca1c8..7b9ca3c 100644 --- a/src/components/Dropdown/types.ts +++ b/src/components/Dropdown/types.ts @@ -7,7 +7,7 @@ export interface DropdownConfig { export type DropdownColorModes = 'dark' | 'light'; export interface DropdownProps { onClick: () => void; - label: string; + label?: string; colorConfig?: DropdownConfig; colorMode?: DropdownColorModes; }