1.7.0 • Published 2 years ago

@s-ui/react-collapsible-composed v1.7.0

Weekly downloads
23
License
MIT
Repository
-
Last release
2 years ago

CollapsibleComposed

Component to display a section with a title and some nodes, and keep some other nodes hidden until the icon is clicked. Then, clicking again will re-hide the items.

All the content can be initially displayed and it can be disposed inline. Also, callback is provided in case the container needs to perform any action.

Installation

$ npm install @s-ui/react-collapsible-composed --save

Usage

Basic usage

import CollapsibleComposed from '@s-ui/react-collapsible-composed'

const callback = (collapse) => alert('Is collapsing? ' + collapse)

const items = [
  'Item visible 1',
  'Item visible 2'
]

const hiddenItems = [
  'Item hidden 1',
  'Item hidden 2'
]

return (
    <CollapsibleComposed
      label='Title'
      items={items}
      hiddenItems={hiddenItems}
      collapsed={false}
      inline
      onToggle={callback}
    />
)
1.7.0

2 years ago

1.6.0

3 years ago

1.5.0

4 years ago

1.4.0

4 years ago