Skip to content

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 input

Imports ​

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 ​

PropTypeDefaultDescription
valuestring-Controlled input value.
defaultValuestring-Initial uncontrolled value.
typeInputType
Values: text, email, password, search, tel, url, number
textNative input type.
placeholderstring-Placeholder text.
disabledboolean-Disables input interaction.
idstring-Native input id attribute.
autocompletestring-Native input autocomplete attribute.
ariaLabelstring-Accessible label for unlabeled inputs.
ariaDescribedbystring-ID reference for additional accessible description.
ariaErrormessagestring-ID reference for accessible error message.

Events ​

EventReact propDetailDescription
value-changeonValueChangevalue: string, nativeEvent: EventEmitted when the input value changes.

Slots ​

SlotDescription
prefixContent before the native input.
suffixContent after the native input.

Styling ​

Uses Tailwind: yes

Theme tokens:

  • border-input
  • ring-ring
  • text-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:

  • cn
  • globals

Files:

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

Released under the MIT License.