New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-swipeable-bottom-sheet

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-swipeable-bottom-sheet

Swipeable Bottom Sheet

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-11.93%
Maintainers
1
Weekly downloads
 
Created
Source

Swipeable Bottom Sheet

A swipeable material's bottom sheet implementation, that uses react-swipeable-views. This can be used to reproduce Material Design's Bottom Sheet guidelines

Alt text

Installation

npm i -S react-swipeable-bottom-sheet

Demo & Examples

Usage

import SwipeableBottomSheet from 'react-swipeable-bottom-sheet';

<SwipeableBottomSheet overflowHeight={64}>
	<div style={{ height: '240px' }}>
		Here goes the content of your bottom sheet
	</div>
</SwipeableBottomSheet>

The bottom sheet's height (when open) scales automatically with its content. If it exceeds the window height, content become scrollable.

Props

NameTypeDefaultDescription
overflowHeightnumber0The height (in px) of the sheet when closed.
openboolUse this property to enable controlled mode. If true, it will open the sheet.
defaultOpenboolfalseIf true, the sheet is open at component mount.
onChangefunction(isOpen)The callback that fires after sheet opens or closes.
onTransitionEndfunction()The callback that fires after opening or closing animation.
fullScreenboolfalseIf true, the sheet takes the full height of the window when open.
marginTopnumber0The top margin applied to the top of the sheet when open. Use this prop to prevent navbar overflow.
shadowTipbooltrueIf true, a box shadow is displayed at sheet bottom when closed. This is used to show that content is hidden below.
topShadowbooltrueIf true, a box shadow is displayed at sheet top border.
overlaybooltrueIf true, an overlay is displayed behind sheet when open. A click on the overlay closes the sheet.
scrollTopAtClosebooltrueIf true, the content is scrolled to the top when sheet closes.
swipeableViewsPropsobject{}Props passed to SwipeableViews component (see documentation).
styleobject{}Style applied on the root (non-swiped) component.
bodyStyleobject{}Style applied on the body of the bottom sheet.
overlayStyleobject{}Style applied on the overlay.

Development (src, lib and the build process)

NOTE: The source code for the component is in src. A transpiled CommonJS version (generated with Babel) is available in lib for use with node.js, browserify and webpack. A UMD bundle is also built to dist, which can be included without the need for any build system.

To build the examples locally, run:

npm install
npm start

Then open localhost:8000 in a browser.

To build, watch and serve the examples (which will also watch the component source), run npm start. If you just want to watch changes to src and rebuild lib, run npm run watch (this is useful if you are working with npm link).

License

MIT

Keywords

FAQs

Package last updated on 20 Sep 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc