GithubHelp home page GithubHelp logo

vimesh-headless's Introduction

Vimesh Headless UI

Features

This is Alpine.js implementation of Tailwind Headless UI. Built with Vimesh UI framework, Vimesh Headless UI has some nice features:

Ultra lightweight

Vimesh Headless UI has much smaller code size

Components Vimesh Headless UI Tailwind Headless UI for Vue Tailwind Headless UI for React
Listbox 8k 34k 30k
Combobox 9k 25k 39k
Menu 7k 18k 20k
Switch 0.6k 5k 6k
Tabs 4k 12k 16k
Dialog 2k 15k 17k
Popover 6k 23k 28k
Radio Group 1k 11k 14k

Comparing the production version of Vimesh and Tailwind headless dialog example page size, Vimesh is much smaller with more features and less bugs (check the menu display in the tailwind popup dialog).

  • Vimesh (192k)
  • Tailwind (425k)

Load only used components dynamically

Components are plain html files, which could be hosted anywhere, normally at CDN. They could be shared cross different projects without extra tree shaking magic. For example, the dialog basic example uses two components hui-dialog and hui-menu. Just load them asynchronously with x-import. Vimesh UI registers corresponding native custom elements and initialize them.

<template x-component:page="dialog-basic" x-import="hui:dialog,menu" x-data="setupDialogBasicData()"
    class="overflow-y-auto">
    ...
    <hui-dialog :open="isOpen" @close="setIsOpen(false)">
        ...
        <hui-menu>
        </hui-menu>
    </hui-dialog>
    ...
</template>

No build, no bundle

What you write is what you get. Organize components to html files under meaningful namespaces. You do not need webpack, rollup, vite etc.

Getting Started

Development mode

Install development dependencies, including alpinejs, @vimesh/style, @vimesh/ui, universal-router and http-server.

yarn

Run static http server

yarn dev

Open the url http://127.0.0.1:8080/playground/dev.html

It shows an index page

There are many examples for different components with relative source code.

It uses development version of alpinejs and @vimesh/ui in the node_modules folder.

Production mode

Please check playground/index.html, which use the latest alpinejs and @vimesh/ui at unpkg.com. In fact it is also what you would do if you use Vimesh Headless UI in your real projects.

<head>
    <link rel="icon" type="image/x-icon" href="./assets/favicon.ico">

    <script src="https://unpkg.com/@vimesh/style"></script>
    <script src="https://unpkg.com/@vimesh/ui"></script>
    <script src="https://unpkg.com/alpinejs" defer></script>
    <script src="https://unpkg.com/universal-router/universal-router.min.js"></script>

    <script>
        const DEBUG = false
        $vui.config.debug = DEBUG
        $vui.config.importMap = {
            "hui": '../components/${component}.html' + (DEBUG ? '?v=' + new Date().valueOf() : '?v=0.1'),
            "app": './components/${path}${component}.html' + (DEBUG ? '?v=' + new Date().valueOf() : '?v=0.1'),
            "page": './pages/${path}${component}.html' + (DEBUG ? '?v=' + new Date().valueOf() : '?v=0.1'),
        }
    </script>
    ...
</head>

Online Playground

Yes, the online playground are 100% plain html hosted at unpkg.com. It is very old school style, right? Let's make frondend development back to what it should be.

vimesh-headless's People

Contributors

finphy avatar vimeshjs avatar xinjie-zhang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

vimesh-headless's Issues

$dispatch here mean what

image

HI @xinjie-zhang

I am a bit confused with this dispatch function, as I saw alpinejs, this dispatch is to invoke an event, and close here is a function, and why and how it works, sorry to ask you something too basic.

Thanks
Eric Xin

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.