# @swim/web

> Thin web application framework built on the @swim/ui toolkit

Latest version **3.10.2** (published 2020-01-20) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @swim/web
pnpm add @swim/web
yarn add @swim/web
bun add @swim/web
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.10.2 |
| Published | 2020-01-20 |
| First published | 2019-02-18 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 26 |
| Unpacked size | 90.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chris Sachs |
| Maintainers | c9r, ctrinh, scottswim, swim-iot |

## Links

- npm: https://www.npmjs.com/package/@swim/web
- Repository: https://github.com/swimos/swim
- Homepage: https://github.com/swimos/swim/tree/master/swim-system-js/swim-web-js/@swim/web
- Issues: https://github.com/swimos/swim/issues
- npm.io page: https://npm.io/package/@swim/web

## Dependencies (26)

- [@swim/dom](https://npm.io/package/@swim/dom.md) 3.10.2
- [@swim/uri](https://npm.io/package/@swim/uri.md) 3.10.2
- [@swim/font](https://npm.io/package/@swim/font.md) 3.10.2
- [@swim/math](https://npm.io/package/@swim/math.md) 3.10.2
- [@swim/time](https://npm.io/package/@swim/time.md) 3.10.2
- [@swim/util](https://npm.io/package/@swim/util.md) 3.10.2
- [@swim/view](https://npm.io/package/@swim/view.md) 3.10.2
- [@swim/angle](https://npm.io/package/@swim/angle.md) 3.10.2
- [@swim/codec](https://npm.io/package/@swim/codec.md) 3.10.2
- [@swim/color](https://npm.io/package/@swim/color.md) 3.10.2
- [@swim/scale](https://npm.io/package/@swim/scale.md) 3.10.2
- [@swim/shape](https://npm.io/package/@swim/shape.md) 3.10.2
- [@swim/style](https://npm.io/package/@swim/style.md) 3.10.2
- [@swim/length](https://npm.io/package/@swim/length.md) 3.10.2
- [@swim/render](https://npm.io/package/@swim/render.md) 3.10.2
- [@swim/webapp](https://npm.io/package/@swim/webapp.md) 3.10.2
- [@swim/animate](https://npm.io/package/@swim/animate.md) 3.10.2
- [@swim/typeset](https://npm.io/package/@swim/typeset.md) 3.10.2
- [@swim/website](https://npm.io/package/@swim/website.md) 3.10.2
- [@swim/streamlet](https://npm.io/package/@swim/streamlet.md) 3.10.2
- [@swim/structure](https://npm.io/package/@swim/structure.md) 3.10.2
- [@swim/transform](https://npm.io/package/@swim/transform.md) 3.10.2
- [@swim/constraint](https://npm.io/package/@swim/constraint.md) 3.10.2
- [@swim/transition](https://npm.io/package/@swim/transition.md) 3.10.2
- [@swim/collections](https://npm.io/package/@swim/collections.md) 3.10.2
- [@swim/interpolate](https://npm.io/package/@swim/interpolate.md) 3.10.2

## Recent versions

- 3.10.2 (latest) — 2020-01-20
- 3.11.0-dev.20200619 (dev) — 2020-06-19
- 3.11.0-dev.20200517 — 2020-05-17
- 3.10.1 — 2019-08-19
- 3.10.0 — 2019-07-22
- 3.9.0 — 2019-02-18

## README

# @swim/web

[![package](https://img.shields.io/npm/v/@swim/web.svg)](https://www.npmjs.com/package/@swim/web)
[![documentation](https://img.shields.io/badge/doc-TypeDoc-blue.svg)](https://docs.swimos.org/js/latest/modules/_swim_web.html)
[![chat](https://img.shields.io/badge/chat-Gitter-green.svg)](https://gitter.im/swimos/community)

<a href="https://www.swimos.org"><img src="https://docs.swimos.org/readme/marlin-blue.svg" align="left"></a>

**@swim/web** implements a thin web application framework built on the
**@swim/ui** toolkit.  **@swim/web** makes it easy to embed
[**@swim/ui**](https://github.com/swimos/swim/tree/master/swim-system-js/swim-ui-js/@swim/ui)
views and [**@swim/ux**](https://github.com/swimos/swim/tree/master/swim-system-js/swim-ux-js/@swim/ux)
widgets in any web page by simply adding special `swim-` attributes to ordinary
HTML elements.  **@swim/web** is a part of the broader
[**@swim/system**](https://github.com/swimos/swim/tree/master/swim-system-js/@swim/system) framework.

## Framework

The **@swim/web** umbrella package depends on, and re-exports, the following
component libraries:

- [**@swim/website**](https://github.com/swimos/swim/tree/master/swim-system-js/swim-web-js/@swim/website)
  ([npm](https://www.npmjs.com/package/@swim/website),
  [doc](https://docs.swimos.org/js/latest/modules/_swim_website.html)) –
  inimalist components that implement common dynamic website behaviors.
- [**@swim/webapp**](https://github.com/swimos/swim/tree/master/swim-system-js/swim-web-js/@swim/webapp)
  ([npm](https://www.npmjs.com/package/@swim/webapp),
  [doc](https://docs.swimos.org/js/latest/modules/_swim_webapp.html)) –
  lightweight web application loader that dynamically instantiates views and
  controllers declared by `swim-` HTML attributes.

**@swim/web** builds on the [**@swim/core**](https://github.com/swimos/swim/tree/master/swim-system-js/swim-core-js/@swim/core)
and [**@swim/ui**](https://github.com/swimos/swim/tree/master/swim-system-js/swim-ui-js/@swim/ui)
frameworks; it has no additional dependencies.

## Installation

### npm

For an npm-managed project, `npm install @swim/web` to make it a dependency.
TypeScript sources will be installed into `node_modules/@swim/web/main`.
Transpiled JavaScript and TypeScript definition files install into
`node_modules/@swim/web/lib/main`.  And a pre-built UMD script, which
bundles all **@swim/web** component libraries, can be found in
`node_modules/@swim/web/dist/main/swim-web.js`.

### Browser

Browser applications can load `swim-web.js`, along with its `swim-core.js`
and `swim-ui.js` dependencies, from the swimOS CDN.

```html
<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-core.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-web.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-ui.min.js"></script>
<script src="https://cdn.swimos.org/js/latest/swim-web.min.js"></script>
```

Alternatively, the standalone `swim-system.js` script may be loaded
from the swimOS CDN, which bundles **@swim/web** together with all other
[**@swim/system**](https://github.com/swimos/swim/tree/master/swim-system-js/@swim/system)
frameworks.

```html
<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-system.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>
```

## Usage

### ES6/TypeScript

**@swim/web** can be imported as an ES6 module from TypeScript and other
ES6-compatible environments.  All component libraries are re-exported by
the umbrella `@swim/web` module.

```typescript
import * as swim from "@swim/web";
```

### CommonJS

**@swim/web** can also be used with CommonJS-compatible module systems.
All component libraries are re-exported by the umbrella `@swim/web` module.

```javascript
var swim = require("@swim/web");
```

### Browser

When loaded by a web browser, the `swim-web.js` script adds all component
library exports to the global `swim` namespace.  The `swim-web.js` script
requires that `swim-core.js` and `swim-ui.js` have already been loaded.

The `swim-system.js` script also adds all **@swim/web** component library
exports to the global `swim` namespace, making it a drop-in replacement
for `swim-web.js` when additional **@swim/system** frameworks are needed.

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