# fl-modale

> >

Latest version **1.0.5** (published 2023-05-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install fl-modale
pnpm add fl-modale
yarn add fl-modale
bun add fl-modale
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-05-01 |
| First published | 2023-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | flesage-000 |
| Maintainers | flesage |

## Links

- npm: https://www.npmjs.com/package/fl-modale
- Repository: https://github.com/flesage-000/fl-modale
- Homepage: https://github.com/flesage-000/fl-modale#readme
- Issues: https://github.com/flesage-000/fl-modale/issues
- npm.io page: https://npm.io/package/fl-modale

## Recent versions

- 1.0.5 (latest) — 2023-05-01
- 1.0.4 — 2023-05-01
- 1.0.3 — 2023-05-01
- 1.0.2 — 2023-04-25
- 1.0.1 — 2023-04-25
- 1.0.0 — 2023-04-24

## README

# fl-modale

>

[![NPM](https://img.shields.io/npm/v/fl-modale.svg)](https://www.npmjs.com/package/fl-modale) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save fl-modale
```

## Usage

```jsx
import React from "react";

import { Flmodale } from "fl-modale";
import "fl-modale/dist/index.css";

function modalExample() {
  const [isOpen, setIsOpen] = useState(true);
  const data = {
    style: {
      overlayBackground: rgba(0,0,0,.75)
    },
    text: "Modal example !"
  }

  render() {
    return <Flmodale data={data} isOpen={isOpen} setMdlOpen={setIsOpen}/>
  }
}
```

## Configurations options
<!-- Markdown table generator => https://meoki.vn/markdowntable/ -->

### Customize content
| Key | Type | Default | Description |
| --- | --- | --- | --- |
| text | `string` | null | The textual content of the modal. |
| textAlignment | `string` | null | Text alignment. Allow "start", "end", "left", "right", "center", "justify", "justify-all" and "match-parent".<br>- [W3C CSS text-align](https://www.w3schools.com/cssref/pr_text_text-align.php) |

### Customize modal styles
| Key | Type | Default | Description |
| --- | --- | --- | --- |
| style.modalBackgroundColor | `string` | #FFF | Modal background color.<br>All HTML color format are allowed (names, RGB, HEX, HSL, RGBA, or HSLA)<br> - [W3C HTML color doc](https://www.w3schools.com/html/html_colors.asp)<br>- [W3C HTML color picker](https://www.w3schools.com/colors/colors_picker.asp) |
| style.modalBorder | `string` | solid 1px black | Modal border.<br> - [CSS border](https://developer.mozilla.org/fr/docs/Web/CSS/border) |

### Customize modal position
Following the centering tutorial offered by [CssTricks](https://css-tricks.com/centering-css-complete-guide/), the modal has two centering possibilities.
| Key | Type | Default | Description |
| --- | --- | --- | --- |
|style.modalPosition.type|`string`||Determines how the modal will be centered. Possible values are: <br>- `fixedWidthHeight` for the centering of the modal whose sizes are fixed.<br>- `unknownWidthHeight` for the centering of the modal without sizes.|

#### **Is the element of fixed width and height?**
In this case, the following options can be usefull.
| Key | Type | Default | Description |
| --- | --- | --- | --- |
|style.modalPosition.height|`string`|"260px"|The height of the modal. Must contain the pixel unit.|
|style.modalPosition.width|`string`|"260px"|The width of the modal. Must contain the pixel unit.|
|style.modalPosition.paddingTop|`string`|"20px"|The padding top of the modal. Must contain the pixel unit.|
|style.modalPosition.paddingRight|`string`|"20px"|The padding right of the modal. Must contain the pixel unit.|
|style.modalPosition.paddingBottom|`string`|"20px"|The padding bottom of the modal. Must contain the pixel unit.|
|style.modalPosition.paddingLeft|`string`|"20px"|The padding left of the modal. Must contain the pixel unit.|

#### **Is the element of unknown width and height?**
In this case, the following options can be usefull.
| Key | Type | Default | Description |
| --- | --- | --- | --- |
|style.modalPosition.paddingTop|`string`|"20px"|The padding top of the modal. Must contain the pixel unit.|
|style.modalPosition.paddingRight|`string`|"20px"|The padding right of the modal. Must contain the pixel unit.|
|style.modalPosition.paddingBottom|`string`|"20px"|The padding bottom of the modal. Must contain the pixel unit.|
|style.modalPosition.paddingLeft|`string`|"20px"|The padding left of the modal. Must contain the pixel unit.|

### Customize overlay
| Key | Type | Default | Description |
| --- | --- | --- | --- |
| style.overlayBackground | `string` | rgba(0,0,0,.5) | Modal overlay color.<br>All HTML color format are allowed (names, RGB, HEX, HSL, RGBA, or HSLA)<br> - [W3C HTML color doc](https://www.w3schools.com/html/html_colors.asp)<br>- [W3C HTML color picker](https://www.w3schools.com/colors/colors_picker.asp) |

## License

MIT © [flesage-000](https://github.com/flesage-000)


## Credits
- Library initalized with [create-react-library-customforked](https://www.npmjs.com/package/create-react-library-customforked)

---
_Source: https://npm.io/package/fl-modale · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
