Input

Text input with error state support. Extends native HTML input attributes.

Example

Current value:

This field is required

Props

PropTypeDefaultDescription
type'text' | 'password' | 'number''text'Input type
errorstringError message displayed below input
classstringAdditional CSS classes

Also accepts all native <input> attributes (placeholder, disabled, etc.).

Usage

<script>
  import { Input } from '@chrissnell/chonky-ui';
  let value = $state('');
</script>

<Input bind:value placeholder="Enter name" />
<Input type="password" placeholder="Password" />
<Input error="Required field" />