Started playing with Svelte
and this is my first attempt to create re-usable component ... no one said that it will be useful :)
npm install svelte-custom-input
value
- the text value to be displayed showPlaceholder
- (default true
) show/hide placeholderplaceholder
- (default PLACEHOLDER
) the text for the placeholderdisabled
- (default false
) enable/disable the inputSomewhere 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}
/>