A library of custom dependent dropdown with custom styles in React applications.
npm install --save react-dependent-dropdownimport React, { Component } from 'react'
import DependentDropdown from 'react-dependent-dropdown'
class Example extends Component {
  render() {
    // Fetch from api
    const categories = ['Electronics', 'Clothing', 'Books']
    // Fetch from api
    const subcategories = {
      Electronics: ['Laptops', 'Smartphones', 'Cameras'],
      Clothing: ['T-shirts', 'Jeans', 'Dresses'],
      Books: ['Fiction', 'Non-fiction', 'Science']
    }
    
    return (
      <DependentDropdown
        categoriesList={categories}
        subcategoriesData={subcategories}
        categoryClass='custom-category' // Apply custom styles to category dropdown
        subcategoryClass='custom-subcategory' // Apply custom styles to subcategory dropdown
      />
    )
  }
}MIT © remonhasan
