npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mui-downshift

v1.4.2

Published

Thin layer over paypal's [downshift](https://github.com/paypal/downshift) to use [Material-UI 1.0](http://material-ui-next.com) visual components

Downloads

1,702

Readme

mui-downshift

Thin layer over paypal's downshift to use Material-UI 1.0 visual components

For examples of <MuiDownshift> in action, see demo or view the source

Features

  • Uses windowing for performance (via react-virtualized)
  • Asynchronous loading of items
    • Infinite scrolling
    • Paginated loading
    • Delayed loading of items until menu is opened
  • Customizable rendering (see getListItem, getInputProps, etc)
  • Control opening menu on input focus (or only on explict toggle)
  • Control height of menu based on number of items or pixels
  • Dynamic row heights using react-virtualized's CellMeasurer
  • Uses a portal to solve the z-index / stacking context problem and Material-UI's popover z-index value
  • All other capabilities inherited from downshift

Props

Property | Type | Required | Description -------- | ---- | -------- | ----------- items | Array | ✓ | Items to show in menu getListItem | Function | | Return an instance of Material-UI's <ListItem /> for each item. defaultProps implementation handles simple cases. getListItemKey | Function | | If defined, should return a deterministic key based on index within items, instead of just the default (default). Passed to react-virtualized's CellMeasurer keyMapper prop. Defining helps resolve an issue with menu changing size or the scroll position jumping around when appending more items. See the paginated fetch for an example. getInputProps | Function | | Customize look of Material-UI's <FormControl> and <Input />. Result of function is merged with Downshift's getInputProps showEmpty | Boolean | | If true, will render a single item if items is empty. Will call getListItem (if defined) with a null item to handle display includeFooter | Boolean | | If true, will render an additional item as the last item. Will call getListItem (if defined) with a null item to handle display. Useful for paginated scrolling (see demo) and showing loading status beyond the loading prop. getInfiniteLoaderProps | Function | | If provided, will wrap menu in react-virtualized InfiniteLoader and pass the props returned from the function. Be sure to provide all required props (isRowLoaded, rowCount, and loadMoreRows). Used for infinite scrolling (see demo). getVirtualListProps | Function | | Pass or override props provided to underlying react-virtualized List component. Note: Setting rowHeight will remove CellMeasurer usage, which is used to calculate heights dynamically. This can provide better performance, especially if set as a static value (ex. 48) getRootProps | Function | | Provide props to the root element that wraps the input and menu components menuItemCount | Number | | Number of items to show on menu before scrolling. Default 5 menuHeight | Number | | Number of pixels to set menu before scrolling. Overrides menuItemCount if set. Default null loading | Boolean | | Show loading indicator focusOnClear | Boolean | | Focus input after clearing. See issue #9 all props available on downshift | | | itemToString, onChange, onStateChange, ... variant | 'standard', 'filled', 'outlined' | | MUI input variant. Default 'standard'

Running Storybook

This project has some storybook stories.

To run storybook, you have to install the story dependencies first:

$ cd stories
$ yarn install
$ cd ..

Then use yarn to run the storybook script:

$ yarn storybook