🌿 A growing search
yarn add tuta
npm i -S tuta
Or access to releases page. Then, download the latest version.
First, if you read as a separate file
<script src="/path/tp/tuta.js"></script>
import Tuta from 'tuta';
new Tuta({
target: document.getElementById('form')
data: {
style: {
// defaults
width: '10em',
height: '2em',
border: '1px solid #222',
borderRadius: '2px',
transition: '.2s cubic-bezier(0.455, 0.03, 0.515, 0.955)',
baseColor: '#fff',
subColor: '#222',
accentColor: '#cb1b45'
},
// Alternate icon (HTML)
// If it is null it will be Octicon's search.
// default: null
icon: null,
// When you put it on the right, it stretches to the left,
// If you place it on the left it will extend to the right.
// default: 'right'
iconPosition: 'right',
onSubmit(searchText, form, reset) {
console.log(arguments);
// Empty the contents of `<input>` and store the form.
reset();
}
}
});
test/fixtures/index.js
example/webpack/index.js
The MIT License (MIT)
Copyright (c) 2017 nju33 nju33.ki@gmail.com