1.1.1 • Published 4 years ago

@socian/socian-mysearch v1.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

Installation

  1. npm i @socian/socian-mysearch

Laravel Setup

  1. Add package in webpack.mix.js

    mix.scripts([
        'node_modules/@socian/socian-mysearch/index.js'
    
    ], 'public/js/my-search.js')
  2. run command

    npm run dev
  3. Add jquery.js and bootstrap.

  4. import script.

    <script src="{{ asset('js/my-search.js') }}"></script>
  5. html

    <div class="form-group col-md-6">
        <!-- For Input Field -->
        <socianSearchKey id="search_input"></socianSearchKey>
        <!-- For Suggestion Dropdown -->
        <div style="display: none;" id="suggestion_array"></div>
        
        <br/>
        <!-- Results -->
        <div id="search_array"></div>
    </div>
    <div class="form-group col-md-6">
        <!-- For Voice Input -->
        <button  id="audio_input">
            <img src="./mic-final.png" height="24" width="24" alt="icon">
        </button>
        <!-- Voice Search Status -->
        <div id="voice_status"></div>
    </div>