# @rcp/util.createmount

> The utility for creating mountable view

Latest version **2.0.0** (published 2024-02-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @rcp/util.createmount
pnpm add @rcp/util.createmount
yarn add @rcp/util.createmount
bun add @rcp/util.createmount
```

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2024-02-27 |
| First published | 2018-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 15.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | imcuttle |
| Maintainers | moyuyc |
| Keywords | imcuttle, util.createmount |

## Links

- npm: https://www.npmjs.com/package/@rcp/util.createmount
- Repository: https://github.com/imcuttle/rcp
- Homepage: https://github.com/imcuttle/rcp#readme
- Issues: https://github.com/imcuttle/rcp/issues
- npm.io page: https://npm.io/package/@rcp/util.createmount

## Recent versions

- 2.0.0 (latest) — 2024-02-27
- 1.0.17 — 2021-09-29
- 1.0.16 — 2020-11-19
- 1.0.14 — 2020-07-04
- 1.0.12 — 2020-07-04
- 1.0.10 — 2020-04-13
- 1.0.9 — 2018-09-14
- 1.0.8 — 2018-09-14
- 1.0.7 — 2018-09-08
- 1.0.6 — 2018-09-08
- 1.0.5 — 2018-09-07

## README

# @rcp/util.createmount

[![NPM version](https://img.shields.io/npm/v/@rcp/util.createmount.svg?style=flat-square)](https://www.npmjs.com/package/@rcp/util.createmount)
[![NPM Downloads](https://img.shields.io/npm/dm/@rcp/util.createmount.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/@rcp/util.createmount)

The utility for creating mountable view

## Installation

```bash
npm install @rcp/util.createmount
# or use yarn
yarn add @rcp/util.createmount
```

## Usage

```javascript
import createMount from '@rcp/util.createmount'
const center = createMount({
  // default's opts in `open` function
})

// The `element` would be mounted on `mountNode`
// and `attributes` is the container node's attributes
center.open({
  element: <div>hahahaha</div>,
  attributes: {
    id: 'container',
    className: 'i-container'
    style: {
      position: 'absolute'
    }
  },
  mountNode: document.body
})
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### createMountCenter

#### Parameters

-   `opts` **IMountOptions&lt;P>** 
    -   `opts.mountNode` **[Node](https://developer.mozilla.org/docs/Web/API/Node/nextSibling)** mountNode fallback in `open` function (optional, default `document.body`)
    -   `opts.attributes` **any?** attributes fallback in `open` function
    -   `opts.element` **ReactElement&lt;P>?** element fallback in `open` function

Returns **IMountCenter** 

## Related

## Authors

This library is written and maintained by imcuttle, <mailto:moyuyc95@gmail.com>.

## License

MIT

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