react-expanded-panel-wrapper

1.2.0 • Public • Published

React Expanded Panel Wrapper

A Panel expender wrapper for react with typescript.

This library uses the React-Modal npm package, it wrappes any component / data and making it expandable with a modal.



To use is, simply wrap the desired content to be expanded with the library's component like so:

import React, { CSSProperties } from 'react'
import ExpandedPanel from 'react-expanded-panel-wrapper'

const fatherDivStyle: CSSProperties = {
    position: 'relative',
    padding: '50px',
    border: 'solid 5px black',
}

const App = () => (
    <div style={fatherDivStyle} >
        <ExpandedPanel>
            This will be expanded
        </ExpandedPanel>
    </div>
)

export default App

The result will be this:

Before: BeforeImage

After: AfterImage On click: AfterImage2

note!

You must have the father component / div have a 'position: relative' css attribute for the icon's to always stick to the top left!

Package Sidebar

Install

npm i react-expanded-panel-wrapper

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

41.9 kB

Total Files

11

Last publish

Collaborators

  • omertal