一套开源的 Web UI 组件库。采用自身极简的模块化规范,并遵循原生 HTML/CSS/JS 的开发模式,极易上手,开箱即用。非常适合网页界面的快速构建。
 
 
Go to file
morning-star d7b7d43c91
fix(form): 修复 label 和 checkbox/radio 关联时的问题 (#2795)
* fix(form): 修复 label 元素和单/多选框关联时的问题

1.两者通过 for 关联时,点击 lable 元素,label 点击事件触发一次 checkbox 属性值更新,但组件内部是通过美化元素的点击事件更新 checkbox 属性值,所以此时美化元素样式不会更新。
2.两者为包含关系时,点击 label 元素,label 点击事件和美化元素的点击事件分别触发一次 checkbox 属性值更新,导致无法正常工作。

* update

* fix(checkbox): 防止事件重复绑定
2025-08-29 17:38:36 +08:00
.gitee chore: 更正 Issue 链接 2023-12-18 13:52:56 +08:00
.github chore: 添加 Issue 发布的默认标题格式 2025-03-11 18:39:29 +08:00
dist release: v2.11.5 2025-07-21 23:26:07 +08:00
docs release: v2.11.5 2025-07-21 23:26:07 +08:00
examples refactor(collapse): 重构折叠面板组件 (#2734) 2025-06-22 22:10:35 +08:00
src fix(form): 修复 label 和 checkbox/radio 关联时的问题 (#2795) 2025-08-29 17:38:36 +08:00
.editorconfig chore: 调整 EditorConfig 规则顺序 2024-07-11 17:49:51 +08:00
.gitignore chore: 优化 .gitignore 结构 2024-07-11 18:30:44 +08:00
CHANGELOG.md docs(CHANGELOG): 优化文本 2024-07-11 17:29:14 +08:00
CODE_OF_CONDUCT.md chore: 新增贡献者行为准则 2023-12-17 15:47:17 +08:00
CONTRIBUTING.md docs: 新增贡献指南的 PR 说明 2024-11-24 23:02:59 +08:00
DISCLAIMER.md docs: 优化 DISCLAIMER 文案 2024-07-11 17:24:56 +08:00
LICENSE docs(LICENSE): 修改 Copyright 及格式文本 2024-07-11 18:30:31 +08:00
README.en-US.md chore: reorder the badges 2024-04-24 17:44:13 +08:00
README.md chore: 调整徽章排列顺序 2024-04-24 17:44:27 +08:00
SECURITY.md style: 优化 Security Policy 排版细节 2023-12-17 16:03:41 +08:00
gulpfile.js build: 更正 component 模块打包顺序 2025-03-10 16:52:05 +08:00
package.json release: v2.11.5 2025-07-21 23:26:07 +08:00

README.en-US.md

Layui

中文 · English

Classic modular front-end UI library

License Version NPM

Layui constitutes an open-source, freely available Web UI component library implementing its distinct lightweight modular specification. It adheres rigorously to the vanilla HTML/CSS/JavaScript development paradigm, thereby affording unparalleled ease of adoption and immediate usability. Characterized by a minimalist, lightweight aesthetic, the framework's core exudes elegance and richness, with each and every detail, inclusive of documentation, meticulously curated to facilitate swift assembly of web interfaces. Distinguishing itself from prevailing mainstream front-end frameworks, Layui does not contravene established principles but rather espouses a philosophy of reverting to fundamental simplicity. Specifically, it caters to pragmatic individuals with a penchant for simplicity, obviating the need for engagement with diverse build tools. it empowers users to intuitively harness and orchestrate the requisite page elements and interactive behaviors directly within the browser environment.

Usage

To use Layui, simply include the core files in your page, such as:

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Quick Start - Layui</title>
    <link href="./layui/css/layui.css" rel="stylesheet" />
  </head>
  <body>
    <!-- HTML Content -->
    <script src="./layui/layui.js"></script>
    <script>
      // Usage
      layui.use(function () {
        var layer = layui.layer;
        // Welcome
        layer.msg("Hello World", { icon: 6 });
      });
    </script>
  </body>
</html>

Documentation

Current version

Contributors

Project contributors

Break with the old and establish the new 🌱

On October 14, 2016, Layui released its first version 1.0.0, after which it was widely adopted across web platforms.

On October 13, 2021, Layui announced the decommissioning of its original official website (details) and migrated its documentation site to Gitee Pages. Concurrently, community management and daily maintenance activities were fully transitioned to both Gitee and Github platforms, encouraging users to embrace other superior mainstream frameworks. This move inadvertently led some to believe that Layui had ceased updates. In reality, since then, Layui has remained active on Github and Gitee, never halting updates, progressing from version 2.6.8 at the time to its current latest release.

On April 24, 2023, Layui released version 2.8.0 officially and launched a new documentation site. This marked a sincere comeback and a continuation of its commitment to open-source ideals. We still uphold the perspective expressed in the announcement two years ago, advocating that developers embrace mainstream technologies and nurture an unwavering passion for cutting-edge advancements. What Layui does is to fill those narrow gaps outside the mainstream. Although not a mainstream frontend framework, Layui has long transcended being a personal creation of its author, becoming a collective work of all who persist in using it. It continues to underpin numerous projects and represents the efforts of many individuals. As open-source creators, we should walk alongside these dedicated Layui developers.

In the future, Layui will steadfastly accompany all those who hold it dear, jointly substantiating the feasibility of the Layui development model.

License

Layui is released under the MIT license. Other relevant agreements may also refer to the Disclaimer.