Git Product home page Git Product logo

typeahead.js-bootstrap4-css's Introduction

Typeahead.js and Bootstrap 4

For Bootstrap 3 try typeaheadjs.css

typeahead.js

The typeahead.js library consists of 2 components: the suggestion engine, Bloodhound, and the UI view, Typeahead. The suggestion engine is responsible for computing suggestions for a given query. The UI view is responsible for rendering suggestions and handling DOM interactions. Both components can be used separately, but when used together, they can provided a rich typeahead experience.

Bootstrap 4

Bootstrap is a sleek, intuitive, and powerful front-end framework for faster and easier web development, created by Mark Otto and Jacob Thornton, and maintained by the core team with the massive support and involvement of the community.

To get started, check out http://getbootstrap.com!

History

With Twitter Bootstrap 3 the typeahead plugin had been dropped. @mdo says: "in favor of folks using Twitter's typeahead. Twitter's typeahead has more features than the old bootstrap-typeahead.js and less bugs." Twitter's typeahead don't work direct with Bootstrap 4. The DOM structure of the dropdown menu used by typeahead.js differs from the DOM structure of the Bootstrap dropdown menu. You'll need to load some additional CSS in order to get the typeahead.js dropdown menu to fit the default Bootstrap theme. You can download the basic CSS here, or use the SCSS file to integrate it into your project. CSS and SCSS are build with the latest SCSS code of Bootstrap 4 (alpha). Code does not introduce new mixins and only extends Bootstrap's SCSS.

Note also the orginal typeahead plugin still works with Bootstrap 4.

Download

How to use

CSS

Include the CSS file after Bootstrap's CSS in your HTML:

<link href="bootstrap.min.css" rel="stylesheet">
<link href="typeaheadjs.css" rel="stylesheet">

Sass

  1. Copy typeaheadjs.scss into your Bootstrap's SCSS folder
  2. Import this file at the end of bootstrap.scss: @import "typeaheadjs.scss";
  3. Recompile Bootstrap

Example

ScreenShot

typeahead.js-bootstrap4-css's People

Contributors

asia653 avatar bassjobsen avatar elpescador-nl avatar theel0ja avatar zedtux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

typeahead.js-bootstrap4-css's Issues

input-group-lg and input-group-sm Not Supported

I noticed input-group-lg and input-group-sm modifiers don't work out of the box.

To get these to work I added:

input-group.input-group-lg{
  span.twitter-typeahead{
    .form-control{
      @extend .form-control-lg;
      @include border-right-radius(0)
    }
  }
}

.input-group.input-group-sm{
  span.twitter-typeahead{
    .form-control{
      @extend .form-control-sm;
      @include border-right-radius(0)
    }
  }
}

Remove or fix Bootstrap import in scss file

The Bootstrap import in typeaheadjs.scss does not work with the current release of Bootstrap 4. The import states...

@import '../bootstrap4/bootstrap-4-dev/scss/bootstrap.scss';

..., but the current path should be...

@import '../bootstrap/scss/bootstrap';

Please either fix the import statement or remove it all together so people are in control of the exact Bootstrap import.

[ EDIT ]
It seems the import statement is removed in the scss file, but when adding the package with yarn the import is still there. How come?

On Bootstrap 4 Alpha 6 a variable is not there anymore

Love this little component... on alpha 6 the SASS variable $font-size-root doesn't exist anymore.
Using $font-size-base should also work but in the following calculation you are doing:

CURRENT:

top:(2 * $input-padding-y + $font-size-base*$line-height-base + 2 * $input-btn-border-width/**$font-size-root**) !important;

NEW:

top:(2 * $input-padding-y + $font-size-base*$line-height-base + 2 * **$input-btn-border-width**/**$font-size-base**) !important;

This however creates an error when compiling because $input-btn-border-width is in pixels and $font-size-base is in rem. Which of-course makes the division problematic.

Unfortunately my knowledge of the px : rem ratios in bootstrap is a bit limited. Thought I'd rather ask you what a proper solution is.

Style not working with Bootstrap 4 Beta

Hi, I'm triyng to render the following html:

<div class="input-group">
    <input class="typeahead form-control" type="text" />
    <span class="input-group-btn">
        <button class="btn btn-primary" type="button" disabled><i class="fa fa-search"></i> Buscar</button>
    </span>
</div>

I'm referencing typeaheadjs.css. But this is what I get:
image

Can you help me please? Is my problem or is a CSS problem? Thank you very much in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.