You can install the module via npm
or yarn
:
npm install react-touch-modal --save
touch drawer
import React from "react";
import Drawer from "react-touch-modal";
const Example = () => {
const [isVisible, setIsVisible] = useState(false);
return (
<Drawer direction={"right"} visible={isVisible} onToggle={() => setIsVisible(prev=>!prev)}>
TEST
</Drawer>,
)
}
Prop | Type | Required? | Default Value | Description |
---|---|---|---|---|
visible | boolean |
Required | - | 사용여부 |
onToggle | function |
Required | - | toggle function |
direction | left or right or top or bottom |
Required | - | drawer 나오는 방향 |
full | boolean |
Optional | false |
modal full screen |
isTouch | boolean |
Optional | true |
touch 여부 |
MIT