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

material-ui-enhanced-fields

v2.0.0

Published

Enhanced fields for material-ui. A TextFields with prefix, suffix and typeahead. A Combobox / autocomplete / typeahead with optional Chip input. Fully-customizable but with simple defaults.

Downloads

16

Readme

material-ui-enhanced-fields

A collection of enhanced fields for use with material-ui (v1 beta).

demo2.gif

See storybook for live demos.

Install

yarn add material-ui-enhanced-fields@next
npm i material-ui-enhanced-fields@next

Components

ComboboxField

A customisable 'combobox' field that allows both text input and selection from a drop-down menu. With multiple set to false (default) the selected value is displayed as text in the <input/> element. With multiple set to true selectedItems are stored in a prefix. The default rendering is Chip's. Items can be grouped into sublist by supplying the a groupField prop (default is 'group'). Based on the Downshift library.

Basic Examples

const DATA = ['apples', 'oranges'];

<ComboboxField
  items={DATA}
  TextFieldProps={{ floatingLabelText: 'Pick a food' }}
/>
const DATA = [{text: 'apple', type: 'fruit'}, {text: 'tomato', type: 'veg'}];
<ComboboxField
  items={DATA}
  itemToString={item => item === null ? '' : item.text}
  groupField={'type'}
  TextFieldProps={{ floatingLabelText: 'Pick a food' }}
/>

Props

prop | type | default | description --- | --- | --- | --- classes | Object || Override the CSS classes (see implementation). className | 'string' || CSS class for the root element. filterFunc | function(items: Array, query: string) | | Override the default function for filtering the items based on the field's input value. items | Array | [] | The array of possible items to select. groupField | string | 'group' | The name of the key to group each item object by. (Optional, if items aren't objects or don't have a field to group by, they won't be grouped.) menuBottomElement | Object || An element to display at the bottom of the menu. menuBottomFixed | boolean | true | Fix the menuBottom element so it's reachable without scrolling. MenuProps | Object || Props to be merged into the Menu component. multiple | boolean | false | Allow multiple selected items. noMatchProps | Object || Props to be merged to the component displayed when there are no matched items. noMatchText | node || Text to be displayed if there are no matched items to display in the menu. renderMenuItem | function({downShiftProps: {}, index: number, item: any, key: string, selectedItems: Array}) || Override the default rendering of each menu item. Should return an element that employ's the Downshift getItemProps 'prop getter' function. See source code and Downshift. renderSelectedItem | function({deselect: function, hasFocus: boolean, item: any, itemToString: function}) || Override the default rendering (uses Chips) of each selected item. (Only applies when the multiple is true.) deselect: A callback that will deselect the item. hasFocus: True if item has been focused with keyboard. item: The item to render. itemToString: The itemToString prop supplied for convenience. SubheaderProps | Object || Props to be merged ino each Subheader. TextFieldProps | Object || Props for the TextField component.

In addtion, you can pass all the props of the Downshift component, except the inputValue. See here.