Download wp-calypso/packages/components/src/swipeable/docs/example.jsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 566 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/swipeable/docs/example.jsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/components/src/swipeable/docs/example.jsx
-
curl -L -o example.jsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/swipeable/docs/example.jsx
566 Bytes
| import { useState } from 'react'; | |
| import Swipeable from '../index'; | |
| const SwipeableExample = () => { | |
| const [ currentPage, setCurrentPage ] = useState( 0 ); | |
| return ( | |
| <Swipeable | |
| onPageSelect={ ( index ) => { | |
| setCurrentPage( index ); | |
| } } | |
| currentPage={ currentPage } | |
| pageClassName="example-page-component-class" | |
| hasDynamicHeight | |
| > | |
| <div>Page 1 - Swipe Left</div> | |
| <div>Page 2 - Swipe Left or Right</div> | |
| <div>Page 3 - Swipe Right</div> | |
| </Swipeable> | |
| ); | |
| }; | |
| SwipeableExample.displayName = 'Swipeable'; | |
| export default SwipeableExample; | |