🚀 Socket Launch Week 🚀 Day 1: Introducing .NET Support in Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-bootstrap-typeahead

Package Overview
Dependencies
Maintainers
0
Versions
182
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bootstrap-typeahead

React typeahead with Bootstrap styling

6.4.1
latest
Source
npm
Version published
Weekly downloads
153K
-21.12%
Maintainers
0
Weekly downloads
 
Created

What is react-bootstrap-typeahead?

The react-bootstrap-typeahead package is a flexible, robust, and highly customizable typeahead (autocomplete) component for React. It is built using Bootstrap styles and provides a variety of features to enhance user experience in form inputs.

What are react-bootstrap-typeahead's main functionalities?

Basic Typeahead

This feature allows you to create a basic typeahead input where users can type and get suggestions from a predefined list of options.

import React from 'react';
import { Typeahead } from 'react-bootstrap-typeahead';

const options = ['John', 'Paul', 'George', 'Ringo'];

function BasicTypeahead() {
  return (
    <Typeahead
      id="basic-typeahead"
      labelKey="name"
      options={options}
      placeholder="Choose a name..."
    />
  );
}

export default BasicTypeahead;

Multiple Selections

This feature allows users to select multiple options from the typeahead suggestions, making it useful for forms that require multiple inputs.

import React from 'react';
import { Typeahead } from 'react-bootstrap-typeahead';

const options = ['John', 'Paul', 'George', 'Ringo'];

function MultiSelectTypeahead() {
  return (
    <Typeahead
      id="multi-select-typeahead"
      labelKey="name"
      multiple
      options={options}
      placeholder="Choose several names..."
    />
  );
}

export default MultiSelectTypeahead;

Custom Rendering

This feature allows you to customize the rendering of the typeahead options, providing more control over the appearance and behavior of the suggestions.

import React from 'react';
import { Typeahead } from 'react-bootstrap-typeahead';

const options = [
  { id: 1, name: 'John' },
  { id: 2, name: 'Paul' },
  { id: 3, name: 'George' },
  { id: 4, name: 'Ringo' }
];

function CustomRenderTypeahead() {
  return (
    <Typeahead
      id="custom-render-typeahead"
      labelKey="name"
      options={options}
      placeholder="Choose a Beatle..."
      renderMenuItemChildren={(option, props) => (
        <div>
          <span>{option.name}</span>
        </div>
      )}
    />
  );
}

export default CustomRenderTypeahead;

Other packages similar to react-bootstrap-typeahead

Keywords

auto complete

FAQs

Package last updated on 19 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts