# @s-ui/react-atom-popover

> AtomPopover is a component that wraps an element and shows a popover around it.

Latest version **3.18.0** (published 2024-05-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @s-ui/react-atom-popover
pnpm add @s-ui/react-atom-popover
yarn add @s-ui/react-atom-popover
bun add @s-ui/react-atom-popover
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.18.0 |
| Published | 2024-05-06 |
| First published | 2019-12-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | daniel.perez.ext, albert.peiro, frandelacasa-adevinta, mariapaula.forero.ext, hpintos_adevinta, sziauberyte, victor.perez.adevinta, oscar-raig-adevinta, carlos.gonzalezl, carolina.mallo.ext, david.nieto, ferran.simon, xavi_conejo, sergi.quintela, jamile.radloff, xavi_ballestar, luz_adv, ignacio.rodriguez, carlosvillu-adevinta, diegomr, arturo.vicente, adria.velardos, emiliovz, dann41, ruben-martin, pol.valls, cristina.rodriguez.duque, sergio.escano, marc.benito, azahara, patricio.sartore, giovanny.sayas.ext, david.cuadrado.ext, alex.castells, beatrizip, pablo.rey-adevinta, sergiocollado, mango.sanchezredondo, cristhianb, alisa_bayanova, davidmartin2108, ferrangbtw, estefania_garcia, belen.santos, alfredo.arronte, joanleon-adv, giodelabarrera.adevinta, luis-garrido, aitor.rodriguez, jordi.munoz, oscar_ramirez, ignacio_navarro, a.ferrer, gfabregoadv, izeller, salvador.juan, oriol.egea, ivanmlaborda, alejandro.ferrante, pa.chruscinski.ext, isabelgomez87, jenifer.lopez, daniela.aguilera, pablogs, javier.miguel, oscar.gomez, marian.lucaci, alverd004, oriol.puig, nacho_torrella, xavi.murcia, chloe.leteinturier, javiauso, alfredo.zimperz, francisco.ruiz.lloret, fermin.adevinta, andresadv, schibstedspain |

## Links

- npm: https://www.npmjs.com/package/@s-ui/react-atom-popover
- npm.io page: https://npm.io/package/@s-ui/react-atom-popover

## Dependencies (4)

- [@s-ui/hoc](https://npm.io/package/@s-ui/hoc.md) 1
- [reactstrap](https://npm.io/package/reactstrap.md) 8.9.0
- [@s-ui/react-hooks](https://npm.io/package/@s-ui/react-hooks.md) 1
- [@loadable/component](https://npm.io/package/@loadable/component.md) 5.15.x

## Recent versions

- 3.18.0 (latest) — 2024-05-06
- 2.0.0-beta.1 (beta) — 2020-07-20
- 3.17.0 — 2022-10-25
- 3.16.0 — 2022-10-25
- 3.15.0 — 2022-10-18
- 3.14.0 — 2022-10-18
- 3.13.0 — 2022-10-07
- 3.12.0 — 2022-10-06
- 3.11.0 — 2022-06-20
- 3.10.0 — 2022-05-23
- 3.9.0 — 2022-05-23
- 3.8.0 — 2022-04-12
- 3.7.0 — 2022-03-08
- 3.6.0 — 2022-03-04
- 3.5.0 — 2021-10-15
- … 22 more at https://npm.io/package/@s-ui/react-atom-popover/versions

## README

# AtomPopover

AtomPopover is a component that wraps an element and shows a popover around it.

## Installation

```sh
$ npm install @s-ui/react-atom-popover --save
```

## Usage

### Basic usage
```js
import AtomPopover, { atomPopoverPositions } from '@s-ui/react-atom-popover'

```

```js
<AtomPopover
  placement={atomPopoverPositions.BOTTOM}
  onClose={() => console.log("CLOSE POPOVER!")}
  content={
    <>
      Hello <strong>world</strong>!
    </>
  }
>
  <div>
    Show Popover
  </div>
</AtomPopover>

```

Some times you may need to programmatically recalculate the `AtomPopover` position in order to fix visual inconsistencies (i.e. a change on the popover content could change the popover size, and therefore recalculating the position may be needed to ensure that popover is displayed as expected). To do so, it's possible to provide a component in the `AtomPopover`'s `content` property, this component will receive a function inside a property named `update`, calling this function will result on a popover's position recalculation.

```js
<AtomPopover
  placement={atomPopoverPositions.BOTTOM}
  onClose={() => console.log("CLOSE POPOVER!")}
  content={({update}) =>
    <>
      Hello <strong>world</strong>!
      <button onClick={update}>Click me to recalculate the popover position!</button>
    </>
  }
>
  <div>
    Show Popover
  </div>
</AtomPopover>

```

The `update` prop is a function provided by `Popper` (v1), which is the library in charge of rendering and positioning the popover component. You can get more information about this function here: https://popper.js.org/docs/v1/#Popper.scheduleUpdate


> **Find full description and more examples in the [demo page](https://sui-components.now.sh/workbench/atom/popover/demo).**

---
_Source: https://npm.io/package/@s-ui/react-atom-popover · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
