A tiny, blazing fast view library that creates reactive Web Components

Overview

dlite logo

dlite

A tiny, blazing fast view library that creates reactive Web Components

npm (tag) gzip bundle size NPM GitHub Sponsors

πŸ“– Complete documentation

https://dlitejs.com

🧐 Introduction

dlite creates Web Components and interactive web pages easily without the bloat of big frameworks. It can be effortlessly added into existing HTML pages to create reusable components for web applications. dlite is perfect for simple, but dynamic static sites or when you want to progressively upgrade a site without changing too much.

⭐ Features

  • Seriously tiny: <10 kB (<5 kB when gzipped)
  • No dependencies, no virtual DOM, no JSX, and no build tool required
  • Reactive Web Components
  • Progressive template language that leverages template literals
  • Props support
  • Computed properties
  • Two-way data binding
  • Events handling
  • Component lifecycle hooks
  • Directives (e.g. if/else, for, style, class)
  • Shadow DOM by default with scoped CSS
  • Put a script tag in your HTML and go ⚑

It is compatible with all modern browsers that support ES2015/ES6, ESM, and Proxy.

πŸ”§ Installation

The easiest way to use dlite is with a script tag.

<script type="module">
  import Dlite from '//unpkg.com/dlite';
</script>

More details about installation.

πŸ”„ Canonical counter example

An example counter component to give you a sense of what dlite looks like. See more examples.

<script type="module">
  import Dlite from '//unpkg.com/dlite';
  
  Dlite({
    el: '#app',
    data: {
      count: 0
    },
    up() {
      this.data.count++;
    },
    down() {
      this.data.count--;
    }
  });
</script>

<template id="app">
  <h1>{this.count}</h1>

  <div>
    <button @click="down">Decrease Count</button>
    <button @click="up">Increase Count</button>
  </div>
</template>

πŸ™‹ FAQ

See the whole FAQ at https://dlitejs.com/faq/.

🧠 Related projects

Similar projects to dlite are listed on https://unsuckjs.com/.

πŸ™Œ Acknowledgements

dlite is forked from the fantastic work done by Mardix with Litedom.

It includes code from these great libraries:

The lightbulb logo is provided from https://openmoji.org/library/emoji-1F4A1/.

You might also like...
micro reactive state management - just for fun

effectus micro reactive state management - just for fun Install $ yarn add effectus Usage import { effect, signal } from 'effectus' const [name, set

Subscribe to any reactive source, weakly

sube Subscribe weakly to any reactive source import sub from './sube.js' unsub = sub(source, onnext, onerror?, oncomplete?) // ...unsubscribe unsub(

A reactive store that is fine, really. It works with React.

trashly A reactive store that is fine, really. It works with React. Note: These docs assume you're using the trashly-react library. The vanilla trashl

A reactive store that is fine, really. It works with React.

A reactive store that is fine, really. It works with React.

A single-file 1kb min+gzip simplified implementation of the reactive core of Solid, optimized for clean code

A single-file 1kb min+gzip simplified implementation of the reactive core of Solid, optimized for clean code

⚑️ Lightning-fast search for React and React Native applications, by Algolia.
⚑️ Lightning-fast search for React and React Native applications, by Algolia.

React InstantSearch is a library for building blazing fast search-as-you-type search UIs with Algolia. React InstantSearch is a React library that let

The simple but very powerful and incredibly fast state management for React that is based on hooks

Hookstate The simple but very powerful and incredibly fast state management for React that is based on hooks. Why? β€’ Docs / Samples β€’ Demo application

πŸ” Holmes is a 0 config, fast and elementary state orchestrator for React

React Holmes πŸ” - Elementary State Orchestrator for React πŸ” Holmes is a 0 config, fast and elementary state orchestrator for React. Holmes has a very

React library for ux4iot for easily building IoT web applications

React library for ux4iot for easily building IoT web applications

Releases(0.19.0)
  • 0.19.0(Feb 26, 2023)

  • 0.18.0(Feb 26, 2023)

  • 0.17.0(Feb 25, 2023)

  • 0.16.2(Feb 16, 2023)

  • 0.16.1(Feb 11, 2023)

  • 0.16.0(Feb 10, 2023)

    • Scoped CSS when attached to a Shadow DOM
    • Make shadowDOM default true (again) now that scoped CSS is working
    • Add debug setting to show dlite error messages on the page while developing
    • Include attributes when converting from a regular DOM element to a Web Component
    • Return components from Dlite initializer for use in JavaScript

    Breaking changes

    • Remove refId setting because attributes (i.e. id) are copied to custom elements and components are now returned from the Dlite initializer
    Source code(tar.gz)
    Source code(zip)
  • 0.15.0(Feb 5, 2023)

  • 0.14.0(Feb 5, 2023)

    • Prevent flickering when rendering for all component types (tagName, el, and in-place elements)
    • Attaching components to a Shadow DOM is now the default; this will be useful for encapsulation and scoped styles in the future
    • Set styles on custom element when on an initial el
    • Add demo for how to use shared component template
    • Switch to vitest from jest for quicker unit tests
    Source code(tar.gz)
    Source code(zip)
  • 0.13.1(Jan 22, 2023)

Owner
Adam Hill
Just a normal dev trying to make the world a better place.
Adam Hill
React ESI: Blazing-fast Server-Side Rendering for React and Next.js

React ESI: Blazing-fast Server-Side Rendering for React and Next.js React ESI is a super powerful cache library for vanilla React and Next.js applicat

KΓ©vin Dunglas 633 Jan 5, 2023
A tiny, reactive JavaScript library for structured state and tabular data.

A JavaScript library for structured state. Using plain old JavaScript objects to manage data gets old very quickly. It's error-prone, tricky to track

tinyplex 1.4k Dec 30, 2022
A tiny ( 1KB) reactivity library

influer A tiny (< 1KB) reactivity library yarn add influer Introduction influer is a tiny reactivity library. Exported in ESM, CJS, and IIFE, all < 1K

Tom Lienard 7 Jul 13, 2022
A lightweight library to create reactive objects

Reactivity As the name says, Reactivity is a lightweight javascript library to create simple reactive objects. Inspired in Redux and Vuex Get started

David Linarez 2 Oct 28, 2021
A tiny library aims to parse HTML to Figma Layer Notation and do it well.

TSDX User Guide Congrats! You just saved yourself hours of work by bootstrapping this project with TSDX. Let’s get you oriented with what’s here and h

ι’ε²š 5 Dec 28, 2022
Harness the power of reactive programming to supercharge your components

Handle your component effects and side-effects in a clear and declarative fashion by using asynchronous data streams (reactive programming). Why? Β· In

FanDuel OSS 810 Jan 7, 2023
A minisize vue2/3 reactive clipboard

vue-reactive-clipboard A minisize vue2/3 reactive clipboard Install Install with yarn: $ yarn add vue-reactive-clipboard Install with npm: $ npm i vue

Cinob 3 Aug 3, 2021
A tiny state manager for React, Svelte, Vue and vanilla JS

dotto.x Dotto.x is a tiny state manager for React, Svelte, and vanilla JS. Lightweight. Core is less than 135 bytes (minified and gzipped). Zero depen

null 108 Nov 2, 2022
A reactive filesystem interface based on Vue 3 reactivity system.

A reactive filesystem interface based on Vue 3 reactivity system.

Guillaume Chau 37 Oct 8, 2022
Teaful - Tiny, easy and powerful React state management

Tiny, easy and powerful React state management library What advantages does it have? ✨ ?? ・Tiny: Less than 1kb package to manage your state in

Teaful 668 Dec 18, 2022