For AI agents: the complete documentation index is available at https://a3s-lab.github.io/UI/v0.1.0/llms.txt, the full documentation bundle is available at https://a3s-lab.github.io/UI/v0.1.0/llms-full.txt, and this page is available as Markdown at https://a3s-lab.github.io/UI/v0.1.0/components/checkbox.md.
  • 简体中文
  • v0.1.0
  • 复选框

    Live previewHTML · CSS · JavaScript

    By clicking this checkbox, you agree to the terms.

    用途

    Include CSS

    导入 Tailwind 和一个完整的 A3S UI 样式包。

    @import "tailwindcss";
    @import "@a3s-lab/ui/a3s.css";

    或者只导入基本 CSS、组成 CSS 组件和一个样式包。

    @import "tailwindcss";
    @import "@a3s-lab/ui/base.css";
    @import "@a3s-lab/ui/components/checkbox.css";
    @import "@a3s-lab/ui/styles/a3s.css";

    使用CDN或批量程序导入?请参见安装页

    Add your checkbox HTML

    Add class="input" to checkbox inputs. Pair it with Field and a native <label> for layout and labeling.

    <input type="checkbox" class="input" />

    示例

    基本

    Pair the checkbox with field and a native <label> for proper layout and labeling.

    Live previewHTML · CSS · JavaScript

    说明

    使用 section 和段落作为帮助文本。

    Live previewHTML · CSS · JavaScript

    By clicking this checkbox, you agree to the terms and conditions.

    已禁用

    使用 disabled 属性来防止交互,并将 data-disabled 添加到 .field 组件以禁用样式。

    Live previewHTML · CSS · JavaScript

    无效

    在复选框上设置 aria-invalid="true",在字段包装器上设置 data-invalid 以显示无效样式。

    Live previewHTML · CSS · JavaScript

    使用多个字段创建复选框列表。

    Live previewHTML · CSS · JavaScript
    Show these items on the desktop:

    Select the items you want to show on the desktop.

    Live previewHTML · CSS · JavaScript
    NameEmailRole
    Sarah Chensarah.chen@example.comAdmin
    Marcus Rodriguezmarcus.rodriguez@example.comUser
    Priya Patelpriya.patel@example.comUser
    David Kimdavid.kim@example.comEditor

    RTL

    dir="rtl" 添加到字段组或祖先。

    Live previewHTML · CSS · JavaScript

    بالنقر على هذا المربع، فإنك توافق على الشروط.