Skip to content

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 label

Imports ​

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 ​

PropTypeDefaultDescription
forstring-ID of the associated form control.
requiredboolean-Shows a required indicator.
disabledboolean-Marks the label as disabled.
visuallyHiddenboolean-Visually hides the label while keeping it accessible.

Events ​

No public events documented.

Slots ​

SlotDescription
defaultLabel content.

Styling ​

Uses Tailwind: yes

Theme tokens:

  • text-foreground
  • text-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:

  • cn
  • globals

Files:

  • templates/react/label.tsx → components/ui/label.tsx
  • templates/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>
}

Released under the MIT License.