0.1.0 • Published 4 years ago
svelte-custom-input v0.1.0
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 displayedshowPlaceholder
- (defaulttrue
) show/hide placeholderplaceholder
- (defaultPLACEHOLDER
) the text for the placeholderdisabled
- (defaultfalse
) 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} />
0.1.0
4 years ago