Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rootre/forms-filtering-dropdown

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rootre/forms-filtering-dropdown

Filtering dropdown for various cases. Depends on @rootre/forms-dropdown

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Filtering dropdown component

Filtering dropdown for various cases. Extends @rootre/forms-dropdown

Installation

With yarn

yarn add @rootre/forms-filtering-dropdown

or with npm

npm install @rootre/forms-filtering-dropdown

Usage

Basic usage:

import React from 'react';
import Dropdown from '@rootre/forms-filtering-dropdown';
import '@rootre/forms-filtering-dropdown/styles.css';

export default function App() {
    const items = [
        {label: 'Cat'},
        {label: 'Dog'},
        {label: 'Rabbit'},
        {label: 'Parrot'},
    ];

    return (
        <div>
            <Dropdown 
                items={items}
                afterChange={item => {
                    console.log('selected item:', item);
                }}
            />
        </div>
    );
}

Note

Demo

Check out basic demo page

Props

It propagates props to @rootre/forms-dropdown component

! Note that itemsTemplate and itemTemplate are already overriden in order to make search input appear and work. If you override them yourself, you end up with broken functionality

searchIn: string

default: label

Determines which item's object property will be used for searching for matches

initialSearchText: string

default: ''

If you want to have preset text in search input

texts: object

For localization of search strings

texts.noResults: string

default: 'No results...'

When no item matches search text

texts.searchPlaceholder: string

default: 'Filter items...'

Placeholder text in search input

Keywords

FAQs

Package last updated on 05 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc