Text inputs are used to collect text from the user. They are commonly used in forms and settings pages.
statedefaultdefaultsuccesswarningerrorsizemediumx-small(height: 20px)small(height: 26px)medium(height: 30px)large(height: 36px)blockfalsetrue, the text input will take the full width of its parent.valueundefinedinput<input> element (bindable).<TextInput placeholder="Basic text input" bind:value={myValue} />
The value is "{myValue}" <TextInput placeholder="X-Small" size="x-small" />
<TextInput placeholder="Small" size="small" />
<TextInput placeholder="Medium (default)" />
<TextInput placeholder="Large" size="large" /> <TextInput
placeholder="This is a default text input"
state="default"
block
/>
<TextInput
placeholder="This is a success text input"
state="success"
block
/>
<TextInput
placeholder="This is a warning text input"
state="warning"
block
/>
<TextInput
placeholder="This is an error text input"
state="error"
block
/> <TextInput placeholder="Search">
<IconSearch slot="start" />
</TextInput> <TextInput placeholder="Delay" type="number">
<span slot="end">minutes</span>
</TextInput> The ending slot is useful with the Loader component to indicate a loading state, for example in a search input.