Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
actionsheet-react
Advanced tools
An action sheet component for react.
Action Sheet is a component that slides in from bottom and has some list of action for the user. Mostly action sheets are used in native mobile application, but action sheet is a very helpful UI element which can be also be used in websites and PWA.
npm i actionsheet-react
yarn add actionsheet-react
import React, { useRef, Fragment } from "react";
import ActionSheet from "actionsheet-react";
const MyComponent = () => {
const ref = useRef();
const handleOpen = () => {
ref.current.open();
};
const handleClose = () => {
ref.current.close();
};
return (
<Fragment>
<button onClick={handleOpen}>Open</button>
<button onClick={handleClose}>Close</button>
<ActionSheet ref={ref}>
<div style={style.content}>🙂 Hi React Devs!</div>
</ActionSheet>
</Fragment>
);
};
const style = {
content: {
height: 300,
display: "flex",
justifyContent: "center",
alignItems: "center",
},
};
import ActionSheet, {ActionSheetRef} from 'actionsheet-react';
const MyComponent = () => {
const ref = useRef<ActionSheetRef>();
// ...rest same as above code
property name | type | more info |
---|---|---|
onClose | callback function | called when the actionsheet is closed |
children | React Children | all the fancy HTML elements that you want to show in the menu |
bgStyle | css styles object | these styles are applied to the background black overlay |
sheetStyle | css styles object | these styles are applied to the sheet component |
mouseEnable | boolean | if true, the sheet can be dragged down using mouse |
touchEnable | boolean | if true, the sheet can be swiped down on touch devices |
threshold | number | the minimum distance dragged, so that sheet will slide down. Threshold is measured in px , default value is 50 |
zIndex | number | the default value is 999 |
closeOnBgTap | boolean | if true, the sheet is closed when the background overlay is tapped |
reverse | boolean | open the sheet in reverse direction |
sheetTransition | string | css transition shorthand, default value transform 0.3s ease-in-out |
bgTransition | string | css transition shorthand, default value opacity 0.5s ease-in-out, z-index 0.5s ease-in-out |
document.body.style.overflow = "hidden";
document.body.style.overflow = "auto";
touchEnable={false}
or you can disable pull-to-refresh.body {
overscroll-behavior: contain;
}
The github repo is always there for you.
FAQs
🌟A lightweight and flexible action sheet component for the web
The npm package actionsheet-react receives a total of 1,937 weekly downloads. As such, actionsheet-react popularity was classified as popular.
We found that actionsheet-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.