@clikvn/react-bottom-sheet
v1.0.3
Published
React library to display clik bottom sheet on your website.
Readme
To develop
Available Scripts
In the project directory, you run: Start storybook
use node version 18
yarn storybookTry to build js
yarn rollupPublic to npmjs
yarn deployRuns the app in the development mode.
Open http://localhost:6006 to view it in the browser.
To use
Installation
npm i @clikvn/react-bottom-sheetor
yarn add @clikvn/react-bottom-sheetUsage/Examples
import { BottomSheet } from "@clikvn/react-bottom-sheet";
import "@clikvn/react-bottom-sheet/dist/cjs/style.css";
function App() {
const bottomSheetRef = useRef<BottomSheetRefTypes>();
useEffect(() => {
bottomSheetRef?.current?.triggerOpen(true)
}, []);
return
<div style={{width:"80vw", height: "80vh"}}>
<button onClick={() => {
bottomSheetRef?.current?.triggerOpen(true)
bottomSheetRef?.current?.expand()
}}
>open
</button>
<BottomSheet
ref={bottomSheetRef}
header={
<div>header</div>
}
{...args}
swipeLevels={DEFAULT_SWIPE_LEVELS}
onChangeSwipeLevel={handleChangeSwipeLevel}
>
content
</BottomSheet>
</div>
}Features
- BottomSheet gitlab
