# magic-virtual-element

> Build virtual tree elements with magic attributes

Latest version **2.0.0-rc1** (published 2016-02-11) · 0 weekly downloads

## Install

```sh
npm install magic-virtual-element
pnpm add magic-virtual-element
yarn add magic-virtual-element
bun add magic-virtual-element
```

## 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 | 2.0.0-rc1 |
| Published | 2016-02-11 |
| First published | 2015-08-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Maintainers | anthonyshort, dominicbarnes |

## Links

- npm: https://www.npmjs.com/package/magic-virtual-element
- Repository: https://github.com/dekujs/magic-virtual-element
- Homepage: https://github.com/dekujs/magic-virtual-element#readme
- Issues: https://github.com/dekujs/magic-virtual-element/issues
- npm.io page: https://npm.io/package/magic-virtual-element

## Dependencies (4)

- [deku](https://npm.io/package/deku.md) ~2.0.0-rc
- [to-style](https://npm.io/package/to-style.md) ^1.3.3
- [classnames](https://npm.io/package/classnames.md) ^2.2.3
- [component-type](https://npm.io/package/component-type.md) ~1.2.0

## Recent versions

- 2.0.0-rc1 (latest) — 2016-02-11
- 1.0.6 — 2015-09-18
- 1.0.4 — 2015-08-06
- 1.0.3 — 2015-08-06
- 1.0.2 — 2015-08-05
- 1.0.1 — 2015-08-04
- 1.0.0 — 2015-08-03

## README

# magic-virtual-element

[![version](https://img.shields.io/npm/v/magic-virtual-element.svg?style=flat-square)](https://www.npmjs.com/package/magic-virtual-element) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)

A library for building virtual tree elements, with enhanced support for class and style properties.

```
npm install magic-virtual-element
```

You can also use Duo, Bower or [download the files manually](https://github.com/dekujs/magic-virtual-element/releases).

## Top-Level API

```js
element(component: string|Function , [props: object], [...children: Array]): Component
```

## Example
```js
import element from 'magic-virtual-element';

let divStyle = {
  color: 'white',
  backgroundImage: 'url(' + imgUrl + ')',
  WebkitTransition: 'all', // note the capital 'W' here
  msTransition: 'all' // 'ms' is the only lowercase vendor prefix
};

element('div', { class: ["App", "foo", "bar"], style: divStyle }, [
  element('button', { class: "Button" }, 'Click Me!')
]);
```

See https://github.com/dekujs/deku#virtual-elements

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