# widgets-for-react

> The widget library allows developers to quickly develop composable and reusable React components by defining a common interface for passing data across different modules of an application.

Latest version **2.1.1** (published 2020-11-19) · ISC license · 111 weekly downloads

## Install

```sh
npm install widgets-for-react
pnpm add widgets-for-react
yarn add widgets-for-react
bun add widgets-for-react
```

## 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.1.1 |
| Published | 2020-11-19 |
| First published | 2018-08-15 |
| Weekly downloads | 111 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 74.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | giuseppemag, weirdwater, mabbadi, thomassantoli, wim_jongeneel |

## Links

- npm: https://www.npmjs.com/package/widgets-for-react
- npm.io page: https://npm.io/package/widgets-for-react

## Dependencies (1)

- [query-string](https://npm.io/package/query-string.md) 5

## Recent versions

- 2.1.1 (latest) — 2020-11-19
- 2.1.0 — 2020-11-19
- 2.0.0 — 2020-11-18
- 1.7.1 — 2020-03-26
- 1.5.7 — 2019-11-19
- 1.7.0 — 2019-10-21
- 1.6.0 — 2019-05-23
- 1.5.6 — 2019-04-17
- 1.5.5 — 2019-04-17
- 1.5.4 — 2019-02-08
- 1.5.3 — 2019-01-29
- 1.5.2 — 2019-01-29
- 1.5.1 — 2018-12-21
- 1.5.1-rc6 — 2018-12-21
- 1.5.1-rc5 — 2018-12-21
- … 23 more at https://npm.io/package/widgets-for-react/versions

## README

# Widgets for React

The widget library allows developers to quickly develop composable and reusable React components by defining a common interface for passing data across different modules of an application.

## Installation

You can install with `npm install widgets-for-react` or `yarn add widgets-for-react`.

## Basic usage

You can create a _hello world_ widget application as follows\:

```typescript
let hello_world_app =
  stateful<string>()(s =>
    div<string>({ className:"form-group" })(
      label<string>("Type text here", { htmlFor:"main-input", label_position: "before" })(
        div<string>({ className:"input-group" })(
          string({ id:"main-input", className:"form-control" })(s)
        )
      )
    )
  )("Hello world!")
```

Widgets have a `run` method which can be invoked in order to embed the widget in a normal React application, as follows\:

```tsx
<div>
  { hello_world_app.run(res =>
    console.log("The widget has produced some output data", res)) }
</div>
```

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