Input
Styled text input component built on the zw-input primitive.
@zeus-web/inputData Entryzweb add inputGenerated
Playground
Source
Choose the framework entry that matches your application.
html
<script type="module">
import '@zeus-web/input/wc/auto'
</script>
<zw-input type="email" placeholder="name@example.com"></zw-input>tsx
import { Input } from '@zeus-web/input/react'
export function InputExample() {
return <Input type="email" placeholder="name@example.com" />
}vue
<script setup lang="ts">
import { Input } from '@zeus-web/input/vue'
</script>
<template>
<Input type="email" placeholder="name@example.com" />
</template>Add
bash
zweb add inputImports
Styled registry component:
tsx
import { Input } from '@/components/ui/input'Primitive React wrapper:
tsx
import { Input } from '@zeus-web/input/react'Web Component entry:
ts
import '@zeus-web/input/wc/auto'Props
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | - | Controlled input value. |
defaultValue | string | - | Initial uncontrolled value. |
type | InputTypeValues: text, email, password, search, tel, url, number | text | Native input type. |
placeholder | string | - | Placeholder text. |
disabled | boolean | - | Disables input interaction. |
id | string | - | Native input id attribute. |
autocomplete | string | - | Native input autocomplete attribute. |
ariaLabel | string | - | Accessible label for unlabeled inputs. |
ariaDescribedby | string | - | ID reference for additional accessible description. |
ariaErrormessage | string | - | ID reference for accessible error message. |
Events
| Event | React prop | Detail | Description |
|---|---|---|---|
value-change | onValueChange | value: string, nativeEvent: Event | Emitted when the input value changes. |
Slots
| Slot | Description |
|---|---|
prefix | Content before the native input. |
suffix | Content after the native input. |
Styling
Uses Tailwind: yes
Theme tokens:
border-inputring-ringtext-muted-foreground
Internal selectors:
[&_[part=root]][&_[data-slot=input]]
Registry
Registry source: available.
Add command: zweb add input
Type: component
Dependencies:
@zeus-web/input
Registry dependencies:
cnglobals
Files:
templates/react/input.tsx→components/ui/input.tsxtemplates/vue/input.vue→components/ui/input.vue
AI usage rules
Do:
- Use Input for text-like form fields.
- Use onValueChange when the user wants Zeus custom events.
Do not:
- Do not style only the host for placeholder or disabled states.
- Do not assume the native input is the custom element itself.
Examples
React styled usage
tsx
import { Input } from '@/components/ui/input'
export function Example() {
return <Input placeholder="Email" type="email" />
}