An open API service indexing awesome lists of open source software.

https://github.com/pardnchiu/quickui

QuickUI is a lightweight frontend framework built on vanilla JavaScript and native APIs. Supports data binding, i18n support, event binding, conditional rendering, and loop rendering.
https://github.com/pardnchiu/quickui

chiuchingwei conditional-rendering front-end-framework javascript-library loop-rendering native-api pardnchiu pardnio pardnltd ui-framework vanilla-javascript virtual-dom

Last synced: about 2 months ago
JSON representation

QuickUI is a lightweight frontend framework built on vanilla JavaScript and native APIs. Supports data binding, i18n support, event binding, conditional rendering, and loop rendering.

Awesome Lists containing this project

README

        

# QuickUI: Lightweight Frontend Framework

> [!NOTE]
> (Formerly known as PDQuickUI, renamed to QuickUI starting from version `0.6.0`)

> QuickUI is a lightweight frontend framework built on pure JavaScript and native APIs. Supports data binding, i18n support, event binding, conditional rendering, and loop rendering.

![tag](https://img.shields.io/badge/tag-JavaScript%20Library-bb4444)
![size](https://img.shields.io/github/size/pardnchiu/QuickUI/dist%2FQuickUI.js)

[![npm](https://img.shields.io/npm/v/@pardnchiu/quickui)](https://www.npmjs.com/package/@pardnchiu/quickui)
[![download](https://img.shields.io/npm/dm/@pardnchiu/quickui)](https://www.npmjs.com/package/@pardnchiu/quickui)
[![jsdeliver](https://img.shields.io/jsdelivr/npm/hm/@pardnchiu/quickui)](https://www.jsdelivr.com/package/npm/@pardnchiu/quickui)

[![](https://img.shields.io/badge/查閱-中文版本-ffffff)](https://github.com/pardnchiu/QuickUI/blob/main/README.zh.md)

## Features

### Efficient Virtual DOM
- Precise diffing algorithm for efficient DOM updates
- Smart attribute patching system that updates only changed values
- Intelligent child node comparison for minimal DOM manipulation

### Reactive Data Handling
- Deep data monitoring system for immediate state tracking
- Automatic UI updates on data changes, no manual operation needed
- Smart caching system to prevent unnecessary re-renders
- Support for nested data structures with reactive handling

### Advanced Template Features
- Built-in internationalization (i18n) support for easy localization
- Dynamic template loading with asynchronous processing
- Powerful expression system supporting calculations, dates, and text processing
- Comprehensive directive system for flexible DOM manipulation

### Performance Optimizations
- Lazy loading for images and SVG content to improve load times
- Minimal file size with zero external dependencies
- Smart event delegation and resource cleanup for optimized memory usage

## Documentation

- Website: [quickui.pardn.io](https://quickui.pardn.io/)
- Documentation: [quickui.pardn.io/doc.html](https://quickui.pardn.io/page/doc.html)

## Installation

### Install via npm
```shell
npm i @pardnchiu/quickui
```

### Include via CDN

#### Include the `QuickUI` library
```html

```

#### Module version
```javascript
// Version 0.6.0 and above
import { QUI } from "https://cdn.jsdelivr.net/npm/@pardnchiu/quickui@[VERSION]/dist/QuickUI.esm.js";

// Version 0.5.4 and below
import { QUI } from "https://cdn.jsdelivr.net/npm/pdquickui@[VERSION]/dist/PDQuickUI.module.js";
```

## How to use

### Initialize `QUI`
```Javascript
const app = new QUI({
id: "", // Specify rendering element
data: {
// Custom DATA
},
event: {
// Custom EVENT
},
when: {
beforeRender: function () {
// Stop rendering
},
rendered: function () {
// Rendered
},
beforeUpdate: function () {
// Stop updating
},
updated: function () {
// Updated
},
beforeDestroy: function () {
// Stop destruction
},
destroyed: function () {
// Destroyed
}
}
});
```

### Render Template
- index.html
```HTML


const test = new QUI({
id: "app",
data: {
hint: "hint 123",
title: "test 123"
},
render: () => `
"{{ hint }}",
h1 {
style: "background: red;",
children: [
"{{ title }}"
]
}`
})

```
- result
```HTML

hint 123

test 123



```

## Overview

### Text & Content
| Attribute | Use Case | Example |
|-----------|----------|---------|
| `{{value}}` | Dynamic text content | `

{{ userName }}

` displays user's name |
| `:html` | Raw HTML insertion | `
` renders formatted content |

### Template Loading
| Attribute | Use Case | Example |
|-----------|----------|---------|
| `:path` | External template loading | `` loads header component |

### List & Iteration
| Attribute | Use Case | Example |
|-----------|----------|---------|
| `:for` | Array/Object iteration | `

  • {{ item.name }}
  • ` renders list items |

    ### Conditional Rendering
    | Attribute | Use Case | Example |
    |-----------|----------|---------|
    | `:if` | Conditional display | `

    Welcome!
    ` |
    | `:else-if`/`:elif` | Secondary conditions | `
    Loading...
    ` |
    | `:else` | Fallback content | `
    Please log in
    ` |

    ### Form Binding
    | Attribute | Use Case | Example |
    |-----------|----------|---------|
    | `:model` | Two-way data binding | `` syncs with data |

    ### Styling & Animation
    | Attribute | Use Case | Example |
    |-----------|----------|---------|
    | `:animation` | Transition effects | `

    Content
    ` |
    | `:[css]` | Dynamic styling | `
    Styled content
    ` |

    ### Dynamic Attributes
    | Attribute | Use Case | Example |
    |-----------|----------|---------|
    | `:[attr]` | Dynamic attributes | `` |

    ### Event Handling
    | Attribute | Use Case | Example |
    |-----------|----------|---------|
    | `@[event]` | Event listeners | `Click me` |

    ## License

    Similar to MIT License but provides obfuscated code only:
    - Same as MIT: Free to use, modify and redistribute, including commercial use
    - Main difference: Provides obfuscated code by default, source code available for purchase
    - License terms: Must retain original copyright notice (same as MIT)

    For detailed terms and conditions, please see the [Software Usage Agreement](https://github.com/pardnchiu/QuickUI/blob/main/LICENSE).

    ## Creator

    邱敬幃 Pardn Chiu





    ***

    ©️ 2024 [邱敬幃 Pardn Chiu](https://pardn.io)