# lit-props

> Lit TypeScript properties made easy

Latest version **3.2.0** (published 2021-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install lit-props
pnpm add lit-props
yarn add lit-props
bun add lit-props
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.0 |
| Published | 2021-10-19 |
| First published | 2020-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=12.0.0 |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mgenware |
| Maintainers | mgenware |
| Keywords | lit |

## Links

- npm: https://www.npmjs.com/package/lit-props
- Repository: https://github.com/mgenware/lit-props
- Issues: https://github.com/mgenware/lit-props/issues
- npm.io page: https://npm.io/package/lit-props

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 3.2.0 (latest) — 2021-10-19
- 3.1.1 — 2021-09-23
- 3.1.0 — 2021-09-15
- 3.0.1 — 2021-05-04
- 3.0.0 — 2021-04-24
- 2.0.0 — 2021-02-02
- 1.1.0 — 2020-11-16
- 1.0.0 — 2020-02-10
- 0.0.2 — 2020-01-08
- 0.0.1 — 2020-01-08

## README

# lit-props

[![Build Status](https://github.com/mgenware/lit-props/workflows/Build/badge.svg)](https://github.com/mgenware/lit-props/actions)
[![npm version](https://img.shields.io/npm/v/lit-props.svg?style=flat-square)](https://npmjs.com/package/lit-props)
[![Node.js Version](http://img.shields.io/node/v/lit-props.svg?style=flat-square)](https://nodejs.org/en/)

Lit TypeScript properties made easy. Zero dependencies.

Without lit-props:

```ts
import { LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';

@customElement('my-element')
export class MyElement extends LitElement {
  @property({ type: Object }) obj = {};
  @property({ type: Number }) id = 0;
  @property({ type: Boolean, reflect: true }) reflectedBool = false;
  @state() protected _counter = 0;
}
```

With lit-props:

```ts
import { LitElement } from 'lit';
import { customElement, property } from 'lit/decorators.js';
import * as lp from 'lit-props';

@customElement('my-element')
export class MyElement extends LitElement {
  @lp.object obj = {};
  @lp.number id = 0;
  @lp.reflected.bool reflectedBool = false;
  @lp.state protected _counter = 0;
}
```

## Installation

```sh
npm i lit-props
```

## Supported property types

```
string
bool
number
array
object

reflected
  string
  bool
  number
  array
  object
```

State is also supported via `state`.

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