1.2.1 • Published 4 years ago

svelte-inline-input v1.2.1

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

svelte-inline-input

An inline editable input component for Svelte.

Displays as text and becomes editable by clicking or tapping.

Example

You can read how it was built here

Installation

npm install svelte-inline-input

Browser

<script type="text/javascript" src="https://unpkg.com/svelte-inline-input"></script>

Module

import InlineInput from 'svelte-inline-input';

Usage

Once installed, it can be used in a template as:

<InlineInput bind:value />

See the props table below for the available options.

Props

PropertyTypeDescriptionDefault
typestringThe input type. Could be text, number, textarea or selecttext
placeholderstringText to be shown as a placeholder while there is no inputempty string
labelClassesstringCSS classes for the label elementempty string
inputClassesstringCSS classes for the input elementempty string
rowsintegerTextarea rows2
colsintegerTextarea columns20
optionsarrayProvides the options for selects. Each object should have the format {label: x, value: x}[]

Events

EventDescription
blurFired when the input element loses focus. Also provides the input element's value

License

MIT