1.0.10 • Published 4 years ago

@aic/react-smart-side-bar v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

#react-smart-side-bar React component which provides the sticky-like behavior to its child block with variable height.

Description

The component allows to create a block, which sticks to page borders during the page scrolling. This sticky block reacts to the changes in height of its child elements, e.g. accordeon open/close.

Installation

npm

npm install @aic/react-smart-side-bar

yarn

yarn add @aic/react-smart-side-bar

Usage

import SmartSideBar from '@aic/react-smart-side-bar'

function App () {
  return (
    <SmartSideBar>
      <div>Sidebar content</div>
    </SmartSideBar>
  )
}

Parameters

Props

PropTypeDefaultDescription
topNumber0Top offset for the sticky block
transitionDurationNumber0Animation duration for sticky block position change or reactive change of its top offset.
staticContentNodenullStatic content which is located inside sidebar but above sticky block.
debugBooleanfalseTurn on debug mode to watch the behavior and actual state of sticky block.

In case any of the parameters's value is not provided, its default value would be applied.

Example

import SmartSideBar from '@aic/react-smart-side-bar'

function App () {
  return (
    <SmartSideBar
      top={3.5}
      transitionDuration={0.3}
      staticContent={
        <div>
          <div>Static content above sidebar</div>
        </div>
      }
    >
      <div>Sidebar content</div>
    </SmartSideBar>
  )
}

Browsers Compatibility

BrowserVersion
Mozilla Firefox22+
Google Chrome51+
Opera38+
Internet Explorer11+
Microsoft Edge15+
Safari11.1+
1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago