Label
Styled label component built on the zw-label primitive.
@zeus-web/labelData Entryzweb add labelGenerated
Playground
Source
Choose the framework entry that matches your application.
html
<script type="module">
import '@zeus-web/label/wc/auto'
</script>
<zw-label for="workspace-name">Workspace name</zw-label>
<input id="workspace-name" value="Zeus" />tsx
import { Label } from '@zeus-web/label/react'
export function LabelExample() {
return (
<div>
<Label for="workspace-name">Workspace name</Label>
<input id="workspace-name" defaultValue="Zeus" />
</div>
)
}vue
<script setup lang="ts">
import { Label } from '@zeus-web/label/vue'
</script>
<template>
<div>
<Label for="workspace-name">Workspace name</Label>
<input id="workspace-name" value="Zeus" />
</div>
</template>Add
bash
zweb add labelImports
Styled registry component:
tsx
import { Label } from '@/components/ui/label'Primitive React wrapper:
tsx
import { Label } from '@zeus-web/label/react'Web Component entry:
ts
import '@zeus-web/label/wc/auto'Props
| Prop | Type | Default | Description |
|---|---|---|---|
for | string | - | ID of the associated form control. |
required | boolean | - | Shows a required indicator. |
disabled | boolean | - | Marks the label as disabled. |
visuallyHidden | boolean | - | Visually hides the label while keeping it accessible. |
Events
No public events documented.
Slots
| Slot | Description |
|---|---|
default | Label content. |
Styling
Uses Tailwind: yes
Theme tokens:
text-foregroundtext-destructive
Internal selectors:
[data-slot=label][data-slot=label-required-indicator]
Registry
Registry source: available.
Add command: zweb add label
Type: component
Dependencies:
@zeus-web/label
Registry dependencies:
cnglobals
Files:
templates/react/label.tsx→components/ui/label.tsxtemplates/vue/label.ts→components/ui/label.ts
AI usage rules
Do:
- Use Label with form controls.
- Use for to associate labels with control ids.
Do not:
- Do not use Label as a generic text wrapper.
Examples
React styled usage
tsx
import { Label } from '@/components/ui/label'
export function Example() {
return <Label for="email">Email</Label>
}