logo-icon
STW UI

Input

Input is a simple input field.

Usage

svelte
import { Input } from 'stwui';
// OR
import Input from 'stwui/input'; // for tree shaking

Basic

With Label

With Leading

With Trailing

With Error

You're doing it wrong!

Disabled

With Password

Input Props

name string nanoid()
type 'text' | 'email' | 'password' text
error string | undefined
placholder string | undefined
value string | undefined
autocomplete 'on' | 'off' | undefined
autocapitalize 'off' | 'none' | 'sentences' | 'words' | 'characters' off
readonly true | undefined
tabindex string | undefined
showPasswordToggle boolean false
allowClear boolean false
disabled boolean false

Input Slots

label <Input.Label slot="label" />
leading <Input.Leading slot="leading" />
trailing <Input.Trailing slot="trailing" />

Input.Label Slots

default

Input.Leading Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Input.Trailing Props

data string (IconData)
viewBox string 0 0 24 24
size string 24px
width string 24px
height string 24px
color string currentColor
stroke string | undefined
fill string currentColor

Input Class Identifiers

stwui-input-wrapper
stwui-input
stwui-input-label
stwui-input-leading-wrapper
stwui-input-clear-wrapper
stwui-input-password-toggle-wrapper
stwui-input-trailing-wrapper
stwui-input-error-icon
stwui-input-error