Skip to content
πŸ’ͺ Combining web components + lit-html + redux (3KB)
Branch: master
Clone or download
Latest commit 02a5f69 Aug 8, 2018

πŸ’ͺ fit-html

npm Travis Bundle Size Greenkeeper badge

3KB web components + lit-html + redux library without bloat.


fit-html is a combination of lit-html, web components and redux bringing efficient rendering and a functional application architecture together. Yet, the total size of the framework is below 3KB, including dependencies.

Small Example

You need the following:

import { connect, withStore } from 'fit-html';
import { html } from 'lit-html/lib/lit-extended';
import { createStore } from 'redux';

Set up redux store:

const todos = (state = [], action) => {
  switch (action.type) {
    case 'ADD_TODO':
      return state.concat([action.text]);
      return state;

const store = createStore(todos, ['Use Redux']);

Define actions and view:

function addTodo() {
  return {
    type: 'ADD_TODO',
    text: `Hello ${Math.random()}`

const render = ({ addTodo, todos }) => html`
    ${ => html`<li>${text}</li>`)}

  <button on-click="${addTodo}">

const TodosApp = connect(
  state => ({ todos: state }),
  { addTodo }

// Define the custom element.
// The withStore mixin is only required for the root element of your
// app. All other πŸ’ͺ-elements will get the redux store from that element.
customElements.define('todo-app', withStore(store)(TodosApp));


    <title>My cool πŸ’ͺ-html app</title>

Please see for more and larger examples.


πŸ’ͺ-html is written for use with evergreen browsers. Not so much for Internet Explorer (though we strive to become compatible with IE11 once lit-html itself is).



You can’t perform that action at this time.