* feat: 重构 laytpl,增强对更多复杂模板结构的解析能力 * Squashed commit of the following: commit6884f80378Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 14:45:58 2025 +0800 release: v2.10.1 commit8d643ad6dcMerge:5521e48c213fe5a2Author: corededitor <107152508+corededitor@users.noreply.github.com> Date: Wed Mar 19 14:24:50 2025 +0800 feat: Merge pull request #2566 from layui/feat/component feat: 优化 component, tabs 若干功能 commit213fe5a209Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 14:15:39 2025 +0800 docs: 添加 component 文档中实验性选项标记 commit5521e48c05Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 14:10:46 2025 +0800 fix: 修复 `body` 初始 `line-height` 无效的问题 (#2569) commit8c7cf0f606Author: 青崖 <33601030+bxjt123@users.noreply.github.com> Date: Wed Mar 19 14:10:08 2025 +0800 优化 checkbox 标签风格选中且禁用时的显示 (#2563) commit23b21254d4Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 14:04:44 2025 +0800 docs: Squashed commit of the following: commit95a0503f41Merge:e6eb86ba87ba4c43Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 14:03:13 2025 +0800 Merge branch 'main' into 2.x commite6eb86bacbAuthor: morning-star <26325820+Sight-wcg@users.noreply.github.com> Date: Wed Mar 19 14:02:05 2025 +0800 docs(slider): 修正错别字 (#2578) commit46f7a9783eMerge:df1fc4f4c204590aAuthor: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Fri Mar 14 19:07:50 2025 +0800 Merge branch 'main' into 2.x commitdf1fc4f419Author: itletu <itletu@163.com> Date: Mon Mar 10 13:54:06 2025 +0800 docs: 更正 class 公共类文档错误 (#2544) | layui-border-box | 设置元素及其所有子元素均为 `box-sizing: border-box` 模型的容器 | commit87ba4c4394Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 13:41:33 2025 +0800 docs(version): 优化 2.9.x 锚点 commita0f533f0fdAuthor: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 13:37:29 2025 +0800 docs: 修复 tabs 文档示例异常问题 commit0f0584e2edAuthor: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 13:35:00 2025 +0800 docs: 修复 tabs 文档中自定义事件示例重新点击 Preview 失效的问题 commit172957d243Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Wed Mar 19 13:29:09 2025 +0800 docs: 优化文档中的用词细节 (#2571) commit094be4ddccAuthor: letianpailove <113023596+letianpailove@users.noreply.github.com> Date: Wed Mar 19 13:28:46 2025 +0800 fix: 更正 class 公共类文档错误 (#2562) commit53ded26cb9Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Sun Mar 16 00:15:25 2025 +0800 fix: 优化 tabs 重载时未按照传入的 closable 正确渲染可关闭状态 commitbd892bf87eAuthor: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Sun Mar 16 00:15:17 2025 +0800 feat(component): 新增 cache 原型方法,用于元素缓存操作 commit6ccc5a453dAuthor: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Sun Mar 16 00:14:18 2025 +0800 fix(component): 优化元素 lay-options 属性上的配置在重载时的优先级 commit79b0a56f50Author: 贤心 <3277200+sentsim@users.noreply.github.com> Date: Sun Mar 16 00:13:55 2025 +0800 fix(component): 修复 reload 时传入的选项未正确合并的问题 * refactor(laytpl): 优化代码细节 * docs: 重写 laytpl 模块文档
Layui
中文 · English
Classic modular front-end UI library
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/JavaScriptdevelopment 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
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.