# hybrids

> A JavaScript framework for creating fully-featured web applications, components libraries, and single web components with unique declarative and functional architecture

Latest version **9.2.1** (published 2026-09-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install hybrids
pnpm add hybrids
yarn add hybrids
bun add hybrids
```

Provides the command `hybrids`.

## Health

**Score 70/100 (B)** — status: active.

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

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 9.2.1 |
| Published | 2026-09-25 |
| First published | 2016-09-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=18.0.0 |
| Dependencies | 0 |
| Unpacked size | 235.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3182 |
| Author | Dominik Lubański |
| Maintainers | smalluban, hybrids |
| Keywords | framework, state management, router, web components, web-components, custom elements, shadow dom, template engine |

## Links

- npm: https://www.npmjs.com/package/hybrids
- Repository: https://github.com/hybridsjs/hybrids
- Homepage: https://hybrids.js.org
- Issues: https://github.com/hybridsjs/hybrids/issues
- npm.io page: https://npm.io/package/hybrids

## Alternatives

- [express-promise-router](https://npm.io/package/express-promise-router.md) — 736.1K weekly downloads
- [next-usequerystate](https://npm.io/package/next-usequerystate.md) — 29.8K weekly downloads
- [@bitkyc08/opencodex](https://npm.io/package/@bitkyc08/opencodex.md) — 4.6K weekly downloads
- [lynkr](https://npm.io/package/lynkr.md) — 575 weekly downloads
- [baremetal.js](https://npm.io/package/baremetal.js.md) — 42 weekly downloads

## Recent versions

- 9.2.1 (latest) — 2026-09-25
- 9.2.0 — 2026-09-17
- 9.1.23 — 2026-08-06
- 9.1.22 — 2026-01-07
- 9.1.21 — 2025-11-28
- 9.1.20 — 2025-10-09
- 9.1.19 — 2025-09-02
- 9.1.18 — 2025-06-13
- 9.1.17 — 2025-05-30
- 9.1.16 — 2025-03-14
- 9.1.15 — 2025-03-05
- 9.1.14 — 2025-02-27
- 9.1.13 — 2025-02-21
- 9.1.12 — 2025-01-24
- 9.1.11 — 2025-01-22
- … 147 more at https://npm.io/package/hybrids/versions

## README

<h1 align="center">
  <img alt="hybrids" src="https://raw.githubusercontent.com/hybridsjs/hybrids/main/docs/assets/hybrids-full-logo.svg?sanitize=true">
</h1>

[![build status](https://github.com/hybridsjs/hybrids/actions/workflows/test.yml/badge.svg)](https://github.com/hybridsjs/hybrids/actions/workflows/test.yml?query=branch%3Amain)
[![coverage status](https://coveralls.io/repos/github/hybridsjs/hybrids/badge.svg?branch=main)](https://coveralls.io/github/hybridsjs/hybrids?branch=main)
[![npm version](https://img.shields.io/npm/v/hybrids.svg?style=flat)](https://www.npmjs.com/package/hybrids)

> An extraordinary JavaScript framework for creating client-side web applications, UI components libraries, or single web components with unique mixed declarative and functional architecture

**Hybrids** provides a complete set of features for building modern web applications:

* **Component Model** based on plain objects and pure functions
* **Global State Management** with external storages, offline caching, relations, and more
* **App-like Routing** based on the graph structure of views
* **Layout Engine** making UI layouts development much faster
* **Localization** with automatic translation of the templates content
* **Hot Module Replacement** support without any additional configuration

### Documentation

The project documentation is available at the [hybrids.js.org](https://hybrids.js.org) site.

## Quick Look

### Component Model

It's based on plain objects and pure functions[^1], still using the [Web Components API](https://developer.mozilla.org/en-US/docs/Web/Web_Components) under the hood:

```javascript
import { html, define } from "hybrids";
  
function increaseCount(host) {
  host.count += 1;
}

define({
  tag: "simple-counter",
  count: 0,
  render: ({ count }) => html`
    <button onclick="${increaseCount}">
      Count: ${count}
    </button>
  `,
});
```

```html
<simple-counter count="42"></simple-counter>
```

[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/edit/hybrids-simple-counter)

You can read more in the [Component Model](https://hybrids.js.org/#/component-model/definition.md) section.

### Global State Management

A global state management uses declarative model definitions with support for async external storages, relations, offline caching, and many more:

```javascript
import { define, store, html } from "hybrids";

const User = {
  id: true,
  firstName: "",
  lastName: "",
  [store.connect] : {
    get: id => fetch(`/users/${id}`).then(...),
  },
};

define({
  tag: "user-details",
  user: store(User),
  render: ({ user }) => html`
    <div>
      ${store.pending(user) && `Loading...`}
      ${store.error(user) && `Something went wrong...`}

      ${store.ready(user) && html`
        <p>${user.firstName} ${user.lastName}</p>
      `}
    </div>
  `,
});
```

```html
<user-details user="2"></user-details>
```

You can read more in the [Store](https://hybrids.js.org/#/store/usage.md) section.

### App-like Routing

Rather than just matching URLs with the corresponding components, the router depends on a tree-like structure of views, which have their own routing configuration. It makes the URLs optional, have out-the-box support for dialogs, protected views, and many more.

```javascript
import { define, html, router } from "hybrids";

import Details from  "./details.js";

const Home = define({
  [router.connect]: { stack: [Details, ...] },
  tag: "app-home",
  render: () => html`
    <template layout="column">
      <h1>Home</h1>
      <nav layout="row gap">
        <a href="${router.url(Details)}">Details</a>
      </nav>
      ...
    </template>  
  `,
});

define({
  tag: "app-router",
  stack: router(Home),
  render: ({ stack }) => html`
    <template layout="column">
      ${stack}
    </template>
  `,
});
```

```html
<app-router></app-router>
```

You can read more in the [Router](https://hybrids.js.org/#/router/usage.md) section.

### Layout Engine

Create CSS layouts in-place in templates, even without using Shadow DOM, but still keeping the encapsulation of the component's styles:

```javascript
define({
  tag: "app-home-view",
  render: () => html`
    <template layout="column center gap:2">
      <div layout="grow grid:1|max">
        <h1>Home</h1>
        ...
      </div>

      <footer layout@768px="hidden">...</footer>
    </template>
  `
});
```

You can read more in the [Layout Engine](https://hybrids.js.org/#/component-model/layout-engine.md) section of the documentation.

### Localization

The library supports automatic translation of the component's content, which makes translation seamless and easy to integrate. Additionally, it provides a way to add dynamic messages with plural forms, HTML content, or use messages outside of the template context. Also, it comes with handy CLI tool to extract messages from the source code!

```javascript
import { define, html, localize } from "hybrids";

define({
  tag: "my-element",
  name: "",
  render: ({ name }) => html`
    <div>Hello ${name}!</div>
  `,
});

localize("pl", {
  "Hello ${0}!": {
    message: "Witaj ${0}!",
  },
});
```

You can read more in the [Localization](https://hybrids.js.org/#/component-model/localization.md) section of the documentation.

## Community

Do you need help? Something went wrong? Feel free to create [an issue](https://github.com/hybridsjs/hybrids/issues/new) in the github repository or join the [Gitter](https://gitter.im/hybridsjs/hybrids) channel.

## License

**Hybrids** is released under the [MIT License](LICENSE).

[^1]: Pure functions only apply to the component definition. Side effects attached to event listeners might mutate the host element.

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