Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ufukbakan/online-only-buttons

Highly customizable network status dependent React button components.
https://github.com/ufukbakan/online-only-buttons

javascript npm react reactjs typescript

Last synced: 4 days ago
JSON representation

Highly customizable network status dependent React button components.

Awesome Lists containing this project

README

        

online-only-buttons



![Statements](https://img.shields.io/badge/statements-90%25-brightgreen.svg?style=flat) ![Branches](https://img.shields.io/badge/branches-87.5%25-yellow.svg?style=flat) ![Functions](https://img.shields.io/badge/functions-66.66%25-red.svg?style=flat) ![Lines](https://img.shields.io/badge/lines-100%25-brightgreen.svg?style=flat)

Only when the client is online clickable React buttons. Usable for forms and highly customizable.

![](https://raw.githubusercontent.com/ufukbakan/online-only-buttons/main/example/capture.gif)

## Simple Usage
```js
import { OnlineButton } from "online-only-buttons";

export default function App() {
return (


Hello World

)
}
```

## Advanced Usage
```js
import { OnlineButton } from "online-only-buttons";

function CustomButton({children}){
return(
window.alert("Hello World!") }>
{children}

)
}

export default function App() {
return (


Customized Button

)
}
```

## Properties
All properties are optional except children.
- **bg** : type=***string***, explication=***background color***
- **fg** : type=***string***, explication=***foreground color***
- **hfg** : type=***string***, explication=***:hover foreground color***
- **hbg** : type=***string***, explication=***:hover background color***
- **dfg** : type=***string***, explication=***disabled foreground color***
- **dbg** : type=***string***, explication=***disabled background color***
- **padding** : type=***string***,
- **margin** : type=***string***,
- **fontSize** : type=***string***,
- **fontFamily** : type=***string***,
- **fontWeight** : type=***string***,
- **borderWidth** : type=***string***,
- **borderRadius** : type=***string***,
- **borderColor** : type=***string***,
- **hBorderColor** : type=***string***, explication=***:hover border color***
- **borderStyle** : type=***string***,
- **transitionDuration** : type=***string***,
- **transitionFunction** : type=***string***,
- **offlineAnimation** : type=***boolean***,
- **offlineMessage** : type=***string***, explication=***message will be displayed when offline***
- **onClick** : type=***MouseEventHandler***
- **children** : type=***string | JSX.Element | JSX.Element[]***, explication=***Child element/s written between component tag***