0.1.0 • Published 4 years ago

svelte-custom-input v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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 :)

screenshot

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} />