@schibstedspain/sui-collapsible-composed

1.3.0 • Public • Published

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 @schibstedspain/sui-collapsible-composed --save

Usage

Basic usage

import CollapsibleComposed from '@schibstedspain/sui-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}
    />
)

Readme

Keywords

none

Package Sidebar

Install

npm i @schibstedspain/sui-collapsible-composed

Weekly Downloads

1

Version

1.3.0

License

MIT

Unpacked Size

8.96 kB

Total Files

7

Last publish

Collaborators

  • schibstedspain