The ds-input component provides styled text inputs with validation support.
ds-input uses the following components internally:
ds-text - For rendering labels and error messages with i18n support
<ds-input name="email" placeholder="Enter your email"></ds-input>
<ds-input type="text" name="username"></ds-input>
<ds-input type="email" name="email" required></ds-input>
<ds-input type="password" name="password"></ds-input>
<ds-input type="number" name="age" min="0" max="120"></ds-input>
label-text="Email Address"
placeholder-key="form.email.placeholder"
<ds-input variant="default" name="field"></ds-input>
<ds-input variant="filled" name="field"></ds-input>
<ds-input variant="outlined" name="field"></ds-input>
error="Please enter a valid email"
| Attribute | Type | Default | Description |
|---|
type | string | 'text' | Input type |
name | string | - | Input name attribute |
value | string | - | Current input value |
placeholder | string | - | Placeholder text |
placeholder-key | string | - | Translation key for placeholder |
label | string | - | Label text |
label-text | string | - | Translation text for label |
disabled | boolean | false | Disable the input |
readonly | boolean | false | Make input read-only |
required | boolean | false | Mark as required |
variant | string | 'default' | Visual variant |
error | string | - | Error message to display |
error-text | string | - | Translation text for error |
| Event | Description |
|---|
input-change | Fired when the value changes |
input-focus | Fired when the input gains focus |
input-blur | Fired when the input loses focus |
| Method | Description |
|---|
focus() | Focus the input |
blur() | Remove focus |
select() | Select all input text |