https://github.com/nju33/tuta
🌿 A growing search
https://github.com/nju33/tuta
form input pure-javascript search
Last synced: over 1 year ago
JSON representation
🌿 A growing search
- Host: GitHub
- URL: https://github.com/nju33/tuta
- Owner: nju33
- License: mit
- Created: 2017-03-24T13:40:20.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-30T07:18:33.000Z (about 9 years ago)
- Last Synced: 2025-01-16T04:06:44.246Z (over 1 year ago)
- Topics: form, input, pure-javascript, search
- Language: JavaScript
- Size: 416 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Tuta
🌿 A growing search

## Install or Download
```sh
yarn add tuta
npm i -S tuta
```
Or access to [releases page](https://github.com/nju33/tuta/releases).
Then, download the latest version.
## Usage
First, if you read as a separate file
```html
```
```js
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 `` and store the form.
reset();
}
}
});
```
### Example
- `test/fixtures/index.js`
- `example/webpack/index.js`
## LICENSE
The MIT License (MIT)
Copyright (c) 2017 nju33