Components

Label 标签

与表单控件关联的无障碍标签,required 自动追加红色星号。

基础

for 绑定控件 id,点击聚焦。

<div class="flex items-center gap-3 max-w-xs">
  <Label for="api-key" required>API Key</Label>
  <Input id="api-key" v-model="key" class="flex-1" placeholder="rc_live_…" />
</div>

API 参考

属性类型默认值说明
forstring—关联控件 id。
requiredbooleanfalse显示必填星号。