Skip to content

Commit

Permalink
Add Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sobabear committed Apr 11, 2024
1 parent 1837f57 commit 599b712
Showing 1 changed file with 42 additions and 26 deletions.
68 changes: 42 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,62 @@
# Getting Started with Create React App
# react-pager-view

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
**react-pager-view** is a simple React component for pagination, allowing users to navigate through a series of pages with ease.

## Available Scripts
## Installation

In the project directory, you can run:
You can install `react-pager-view` via npm:

### `npm start`
```bash
npm install react-pager-view
```

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
Or via yarn:

The page will reload if you make edits.\
You will also see any lint errors in the console.
```bash
yarn add react-pager-view
```

### `npm test`
## Usage

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
```javascript
import React from 'react';
import ImagePagination from 'react-pager-view';

### `npm run build`
const pages = [
{ src: 'image1.jpg', text: 'Page 1' },
{ src: 'image2.jpg', text: 'Page 2' },
];

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.
const App = () => {
return (
<div>
<ImagePagination
pages={pages}
dotDisplay={false}
isInfinite={true}
/>
</div>
);
};

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!
export default App;
```

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
## Props

### `npm run eject`
- `pages`: An array of objects representing each page. Each object should have a `src` property for the image source and an optional `text` property for additional text.
- `dotDisplay`: (Optional) Boolean indicating whether to display dots for each page. Default is `false`.
- `isInfinite`: (Optional) Boolean indicating whether to enable infinite scrolling. Default is `true`.

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
## License

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.
## Author

## Learn More
- **Yongjun Lee** - [sobabear](https://www.sobabear.com)

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
## Repository

To learn React, check out the [React documentation](https://reactjs.org/).
- [GitHub Repository](https://github.com/sobabear/ReactPager)

0 comments on commit 599b712

Please sign in to comment.