1.0.8 • Published 7 years ago

bisu-react-search-modal v1.0.8

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

bisu-react-search-modal

Travis npm package Coveralls

React Search Modal similar to Spotlight.

Installation

npm install --save bisu-react-search-modal
then include this scss file to your main scss

@import '~bisu-react-modal/lib/style.scss'; @import '~bisu-react-search-modal/lib/style.scss';

Usage

import React, { Component } from 'react'
import SearchModal from 'bisu-react-search-modal'

class ShowModal extends Component {

  constructor(props) {
    super(props)
    this.state = {
      showModal: false,
    }
  }

  _onSubmit = (term) => {
    alert('You searched for: ', term)
  }

  render() {
    const { showModal } = this.state

    return (
      <div>
        <button type="button" onClick={() => this.setState({ showModal: true })}>Show SearchModal</button>
        <SearchModal
          placeholder="Search term"
          handleClose={() => this.setState({ showModal: false })}
          isOpen={showModal}
          onSubmit={this._onSearch}
        >
          <div>Search results here.</div>
        </SearchModal>
      </div>
    )
  }
}
1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago