@synerise/ds-menu
TypeScript icon, indicating that this package has built-in type declarations

0.20.3 • Public • Published

id: menu title: Menu

Menu UI Component

Installation

npm i @synerise/ds-menu
or
yarn add @synerise/ds-menu

Usage

import Menu from '@synerise/ds-menu'

const items = [
  {
    text: 'Item 1',
    copyable: true,
    copyHint: 'Copy to clipboard',
    copyValue: 'Item 1',
    copyTooltip: 'Copied Item 1!'
  },
 {
    text: 'Item 2',
    copyable: true,
    copyHint: 'Copy to clipboard',
    copyValue: 'Item 2',
    copyTooltip: 'Copied Item 2!'
  },
];

// Render using dataSource passed as prop
<Menu  dataSource={items} />

// Render using dataSource mapping to Menu.Item
<Menu>
    {items.map(item => <Menu.Item {...item}/>}
</Menu>

Demo

<iframe src="/storybook-static/iframe.html?id=components-menu--default"></iframe>

Menu

Property Description Type Default
asDropdownwMenu Add additional styles for dropdown menu boolean false
dataSource Array of items to display in menu MenuItemProps[] -
ordered Determines if items should be displayed with index prefix (starting from 01) boolean false
maxToShowItems limits the number of items rendered. remaining are shown after button click number -
texts custom translations MenuTexts -

MenuItemProps

Property Description Type Default
children Children of the item React.ReactNode
copyable Boolean to enable option of copying the value to the clipboard boolean false
copyHint Text displayed on hovering copyable item string
copyValue Value to be copied to clipboard when copyable item is clicked string
copyTooltip Tooltip to be displayed when copyable item is clicked string / React.ReactNode
disabled Disable an item element boolean false
description Additional description displayed inside the item string / React.ReactNode
highlight Text to be highlighted inside the item string
indentLevel Indent level of the text inside the item. Number 0
parent Boolean to display arrow for parent item boolean false
prefixel Prefix element node or a function to render it. (hovered: boolean) => React.ReactNode / React.ReactNode -
prefixVisibilityTrigger Trigger for displaying the prefix element default / hover default
size Size of the item. Affects the maximum and minimum height. default / large default
suffixel Suffix element node or a function to render it. (hovered: boolean) => React.ReactNode / React.ReactNode -
suffixVisibilityTrigger Trigger for displaying the suffix element default / hover default
subMenu Array of nested items MenuItemProps[]
text Text displayed inside the item string / React.ReactNode -
type Type of the item default / select / danger default

MenuTexts

Property Description Type Default
showLess toggle button label ReactNode -
showMore toggle button label ReactNode -

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.20.323latest

Version History

VersionDownloads (Last 7 Days)Published
0.20.323
0.20.24
0.20.12
0.20.01
0.19.160
0.19.150
0.19.142
0.19.130
0.19.120
0.19.110
0.19.100
0.19.90
0.19.80
0.19.70
0.19.60
0.19.50
0.19.40
0.19.30
0.19.20
0.19.10
0.19.00
0.18.231
0.18.220
0.18.210
0.18.200
0.18.190
0.18.180
0.18.170
0.18.160
0.18.150
0.18.140
0.18.131
0.18.120
0.18.110
0.18.100
0.18.90
0.18.80
0.18.70
0.18.60
0.18.50
0.18.4153
0.18.317
0.18.20
0.18.10
0.18.010
0.17.20127
0.17.1913
0.17.189
0.17.170
0.17.161
0.17.150
0.17.140
0.17.130
0.17.120
0.17.110
0.17.101
0.17.91
0.17.81
0.17.70
0.17.60
0.17.50
0.17.40
0.17.30
0.17.20
0.17.11
0.17.00
0.16.077
0.15.852
0.15.72
0.15.61
0.15.51
0.15.43
0.15.12
0.15.02
0.14.02
0.13.24
0.13.12
0.13.02
0.12.54
0.12.42
0.12.32
0.12.23
0.12.12
0.12.02
0.11.615
0.11.52
0.11.42
0.11.32
0.11.22
0.11.12
0.11.02
0.10.456
0.10.445
0.10.433
0.10.423
0.10.412
0.10.402
0.10.392
0.10.382
0.10.372
0.10.353
0.10.362
0.10.342
0.10.332
0.10.322
0.10.313
0.10.303
0.10.292
0.10.282
0.10.272
0.10.262
0.10.232
0.10.202
0.10.192
0.10.183
0.10.172
0.10.162
0.10.153
0.10.142
0.10.132
0.10.122
0.10.112
0.10.102
0.10.92
0.10.82
0.10.72
0.10.62
0.10.52
0.10.42
0.10.32
0.10.22
0.10.12
0.10.02
0.9.02
0.8.42
0.8.23
0.8.12
0.8.02
0.7.203
0.7.192
0.7.182
0.7.172
0.7.163
0.7.152
0.7.142
0.7.132
0.7.122
0.7.112
0.7.102
0.7.92
0.7.82
0.7.72
0.7.62
0.7.52
0.7.42
0.7.32
0.7.22
0.7.12
0.6.162
0.6.152
0.6.142
0.6.132
0.6.122
0.6.112
0.6.102
0.6.82
0.6.72
0.6.62
0.6.52
0.6.42
0.6.32
0.6.22
0.6.12
0.6.02
0.5.272
0.5.262
0.5.252
0.5.242
0.5.232
0.5.222
0.5.212
0.5.202
0.5.192
0.5.182
0.5.172
0.5.162
0.5.152
0.5.142
0.5.132
0.5.122
0.5.112
0.5.102
0.5.92
0.5.83
0.5.72
0.5.63
0.5.52
0.5.42
0.5.33
0.5.23
0.5.13
0.5.03
0.4.22
0.4.13
0.4.02
0.3.62
0.3.52
0.3.42
0.3.32
0.3.22
0.3.12
0.3.02
0.2.22
0.2.12
0.2.02
0.1.42
0.1.32
0.1.22
0.1.12
0.1.02
0.0.72
0.0.62
0.0.52
0.0.42
0.0.32
0.0.12
0.0.22

Package Sidebar

Install

npm i @synerise/ds-menu

Weekly Downloads

17

Version

0.20.3

License

ISC

Unpacked Size

178 kB

Total Files

56

Last publish

Collaborators

  • synerise