1.0.0 • Published 2 years ago

@eteg/react-dropdowns v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

@garden/components npm version

This package includes several varieties of notifications and wells within the Garden Design System.

Installation

npm install @garden/components

# Peer Dependencies - Also Required
npm install react react-dom styled-components @zendeskgarden/react-theming @zendeskgarden/react-dropdowns

Usage

import { ThemeProvider } from '@zendeskgarden/react-theming';
import { SelectSearchable } from '@garden/components'

const selectSearchableOptions = [
  "Asparagus",
  "Brussel sprouts",
  "Cauliflower",
  "Garlic",
  "Jerusalem artichoke",
  "Kale",
  "Lettuce",
  "Onion",
  "Mushroom",
  "Potato",
  "Radish",
  "Spinach",
  "Tomato",
  "Yam",
  "Zucchini",
]

/**
 * Place a `ThemeProvider` at the root of your React application
 */
<ThemeProvider>
  <SelectSearchable
          label="Choose a vegetable"
          options={selectSearchableOptions}
          onSelect={(item) => console.log(`${item} selected.`)}
        />
</ThemeProvider>;

SelectSearchable

Prop nameTypedefaultdescriptionrequired
optionsstring[]An array containing just the names of all optionsyes
labelstringA name that describes the dropdown menuyes
onSelect(item: string) => voidSelect the item clickedno