svelte-custom-input

0.1.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i svelte-custom-input

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

32 kB

Total Files

6

Last publish

Collaborators

  • stefan.stoichev