You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@blueprintjs/select

Package Overview
Dependencies
Maintainers
1
Versions
247
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueprintjs/select

Components related to selecting items from a list

6.0.1
latest
npmnpm
Version published
Weekly downloads
163K
-7.42%
Maintainers
1
Weekly downloads
 
Created

What is @blueprintjs/select?

@blueprintjs/select is a package from the Blueprint.js library that provides a set of components for building complex and customizable select menus, dropdowns, and multi-select interfaces. It is designed to be highly flexible and integrates seamlessly with the rest of the Blueprint.js ecosystem.

What are @blueprintjs/select's main functionalities?

Single Select

This feature allows you to create a single select dropdown menu. The `Select` component is used to render a list of items, and the `MenuItem` component is used to display each item. The `onItemSelect` callback is triggered when an item is selected.

import { Select } from '@blueprintjs/select';
import { MenuItem } from '@blueprintjs/core';

const items = ["Apple", "Banana", "Cherry"];

const renderItem = (item, { handleClick, modifiers }) => (
  <MenuItem
    key={item}
    text={item}
    onClick={handleClick}
    active={modifiers.active}
  />
);

const SingleSelect = Select.ofType();

const App = () => (
  <SingleSelect
    items={items}
    itemRenderer={renderItem}
    onItemSelect={(item) => console.log(item)}
  >
    <button className="bp3-button bp3-icon-caret-down">Select an item</button>
  </SingleSelect>
);

Multi Select

This feature allows you to create a multi-select dropdown menu. The `MultiSelect` component is used to render a list of items, and the `MenuItem` component is used to display each item. The `onItemSelect` callback is triggered when an item is selected, and the `tagInputProps` is used to handle the removal of selected items.

import { MultiSelect } from '@blueprintjs/select';
import { MenuItem, Tag } from '@blueprintjs/core';

const items = ["Apple", "Banana", "Cherry"];

const renderItem = (item, { handleClick, modifiers }) => (
  <MenuItem
    key={item}
    text={item}
    onClick={handleClick}
    active={modifiers.active}
  />
);

const MultiSelectComponent = MultiSelect.ofType();

const App = () => {
  const [selectedItems, setSelectedItems] = React.useState([]);

  const handleItemSelect = (item) => {
    setSelectedItems([...selectedItems, item]);
  };

  const handleTagRemove = (item) => {
    setSelectedItems(selectedItems.filter(i => i !== item));
  };

  return (
    <MultiSelectComponent
      items={items}
      itemRenderer={renderItem}
      selectedItems={selectedItems}
      onItemSelect={handleItemSelect}
      tagRenderer={(item) => item}
      tagInputProps={{ onRemove: handleTagRemove }}
    />
  );
};

Custom Filtering

This feature allows you to implement custom filtering logic for the select menu. The `itemPredicate` prop is used to filter the list of items based on the user's input. In this example, the `filterItems` function filters items that include the query string.

import { Select } from '@blueprintjs/select';
import { MenuItem } from '@blueprintjs/core';

const items = ["Apple", "Banana", "Cherry"];

const renderItem = (item, { handleClick, modifiers }) => (
  <MenuItem
    key={item}
    text={item}
    onClick={handleClick}
    active={modifiers.active}
  />
);

const filterItems = (query, items) => {
  return items.filter(item => item.toLowerCase().includes(query.toLowerCase()));
};

const SingleSelect = Select.ofType();

const App = () => (
  <SingleSelect
    items={items}
    itemRenderer={renderItem}
    itemPredicate={filterItems}
    onItemSelect={(item) => console.log(item)}
  >
    <button className="bp3-button bp3-icon-caret-down">Select an item</button>
  </SingleSelect>
);

Other packages similar to @blueprintjs/select

Keywords

palantir

FAQs

Package last updated on 17 Jul 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