Giter VIP home page Giter VIP logo

mui-downshift's Introduction

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.
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
all props available on downshift itemToString, onChange, onStateChange, ...

mui-downshift's People

Contributors

oliviertassinari avatar techniq avatar wingfield4 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.