Skip to content

Commit d11a16c

Browse files
Initial commit
0 parents  commit d11a16c

18 files changed

+1288
-0
lines changed

.github/workflows/npm-publixh.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish Node.js Package
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 18
19+
registry-url: https://registry.npmjs.org/
20+
- run: npm i
21+
- run: npm run build
22+
- run: npm publish --access=public
23+
env:
24+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/node_modules/
2+
/.idea/
3+
/.vs/
4+
/.vscode/

LICENSE

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Gaurav Nyaupane (nightmaregaurav) (https://github.com/nightmaregaurav)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
## Go To Top Button (React)
2+
[![npm version](https://badge.fury.io/js/@nightmaregaurav%2Freact-go-to-top-button.svg)](https://badge.fury.io/js/@nightmaregaurav%2Freact-go-to-top-button) [![HitCount](https://hits.dwyl.com/nightmaregaurav/react-go-to-top-button.svg?style=flat)](http://hits.dwyl.com/nightmaregaurav/react-go-to-top-button)<br>
3+
[![NPM](https://nodei.co/npm/@nightmaregaurav/react-go-to-top-button.png?mini=true)](https://nodei.co/npm/@nightmaregaurav/react-go-to-top-button/)
4+
***
5+
### Description
6+
React Go To Top Button is a simple and customizable go to top button for your react application.
7+
8+
### Installation
9+
Install react-go-to-top-button
10+
```bash
11+
npm install @nightmaregaurav/react-go-to-top-button
12+
```
13+
14+
### Usage
15+
```typescript
16+
import React from 'react';
17+
import GoToTopButton from "@nightmaregaurav/react-go-to-top-button";
18+
19+
const Index = () => {
20+
return (
21+
<GoToTopButton
22+
backgroundColor={"#000"}
23+
backgroundColorOnHover={"#333"}
24+
arrowColor={"#fff"}
25+
arrowColorOnHover={"#fff"}
26+
/>
27+
);
28+
};
29+
30+
export default Index;
31+
32+
```
33+
34+
***
35+
## Technical Details
36+
* Language: Typescript
37+
38+
## How to Contribute
39+
* Fork the repository
40+
* Clone the forked repository
41+
* Make changes
42+
* Commit and push the changes
43+
* Create a pull request
44+
* Wait for the pull request to be merged
45+
* Celebrate
46+
* Repeat
47+
48+
*If you are new to open source, you can read [this](https://opensource.guide/how-to-contribute/) to learn how to contribute to open source projects.*<br>
49+
*If you are new to GitHub, you can read [this](https://guides.github.com/activities/hello-world/) to learn how to use GitHub.*<br>
50+
*If you are new to Git, you can read [this](https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud) to learn how to use Git.*<br>
51+
*If you are new to TypeScript, you can read [this](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html) to learn how to use TypeScript.*<br>
52+
53+
## License
54+
React Go To Top Button is released under the MIT License. You can find the full license details in the [LICENSE](LICENSE) file.
55+
56+
Made with ❤️ by [NightmareGaurav](https://github.com/nightmaregaurav).
57+
58+
---
59+
Open For Contribution
60+
---

dist/GoToTopButton.js

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/GoToTopButton.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/goToTopButton.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.back-to-top {
2+
position: fixed;
3+
display: flex;
4+
align-items: center;
5+
justify-content: center;
6+
visibility: hidden;
7+
opacity: 0;
8+
right: 15px;
9+
bottom: 15px;
10+
z-index: 996;
11+
width: 40px;
12+
height: 40px;
13+
border-radius: 50px;
14+
transition: all 0.4s;
15+
}
16+
.back-to-top b {
17+
font-size: 28px;
18+
line-height: 0;
19+
}
20+
21+
.back-to-top.active {
22+
visibility: visible;
23+
opacity: 1;
24+
}

dist/index.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/types/GoToTopButton.d.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import React, { CSSProperties } from 'react';
2+
import "./goToTopButton.css";
3+
interface GoToTopButtonProps {
4+
arrowComponent?: JSX.Element;
5+
backgroundColor: Exclude<CSSProperties['backgroundColor'], undefined>;
6+
backgroundColorOnHover: Exclude<CSSProperties['backgroundColor'], undefined>;
7+
arrowColor: Exclude<CSSProperties['color'], undefined>;
8+
arrowColorOnHover: Exclude<CSSProperties['color'], undefined>;
9+
}
10+
declare const GoToTopButton: ({ arrowComponent, backgroundColor, backgroundColorOnHover, arrowColor, arrowColorOnHover }: GoToTopButtonProps) => React.JSX.Element;
11+
export default GoToTopButton;

0 commit comments

Comments
 (0)