An open API service indexing awesome lists of open source software.

https://github.com/kvnol/input-filter

A tiny library for filtering content based in the input value.
https://github.com/kvnol/input-filter

filter javascript tiny-library

Last synced: about 1 year ago
JSON representation

A tiny library for filtering content based in the input value.

Awesome Lists containing this project

README

          

# Input Filter

A tiny library for filtering content based in the input value.

## Sumary

- [Configuration](#configuration)
- [Select filter](#select-filter)
- [Options](#options)
- [hasSiblings](#hassiblings)
- [TODO](#to-do)
- [License](#license)

## Configuration

### Select filter

Configure the select filter using `[data-type="select"]` on the `` tag:

```html

Filter
Red
Green
Blue

```

And the items that will be filtered with `data-type="filter-item"` and `data-value=""`:

```html






```

Initialize the filter call the `filter` function:

```javascript

filter('[data-type="select"]', false);

```

#### [View the example here](https://codepen.io/kvnol/pen/vdqYYE)

## Options

The input filter has some options:

#### hasSiblings

The `hasSiblings` is a boolean option to filter with more than one ``.

```javascript

filter('[data-type="select"]', hasSiblings);

```

## TODO

- [x] Create filter for select input
- [ ] Create filter for text input
- [ ] Remove libDOM dependency
- [ ] Publish on NPM

## License

Kevin Oliveira © MIT