svelte-input Svelte Themes

Svelte Input

Small Svelte input box component ... just for testing

Svelte Input Component

Started playing with Svelte and this is my first attempt to create re-usable component ... no one said that it will be useful :)

Instalation

npm install svelte-custom-input

Properties

  • value - the text value to be displayed
  • showPlaceholder - (default true) show/hide placeholder
  • placeholder - (default PLACEHOLDER) the text for the placeholder
  • disabled - (default false) enable/disable the input

Usage

Somewhere is your Svelte code:

import svInput from 'svelte-custom-input'

let inputText = 'My input value'
let placeholder = 'Placeholder text'

And in the html part:

<svInput 
    bind:value={inputText} 
    showPlaceholder={true} 
    placeholder={placeholder} 
    disabled={false} 
/>

Top categories

svelte logo

Need a Svelte website built?

Hire a professional Svelte developer today.
Loading Svelte Themes