Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

material-ui-chip-input

Package Overview
Dependencies
Maintainers
2
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

material-ui-chip-input

A chip input field using Material-UI.

  • 0.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
34K
increased by10.61%
Maintainers
2
Weekly downloads
 
Created
Source

material-ui-chip-input

This project provides a chip input field for Material-UI. It is inspired by Angular Material's chip input.

Demo

If you want to try the component yourself instead of watching a gif, head over to the storybook for a live demo!

Installation

npm i --save material-ui-chip-input

Usage

The component supports either controlled or uncontrolled input mode. If you use the controlled mode (by setting the value attribute), the onChange callback won't be called.

import ChipInput from 'material-ui-chip-input'

// uncontrolled input
<ChipInput
  defaultValue={['foo', 'bar']}
  onChange={(chips) => handleChange(chips)}
/>

// controlled input
<ChipInput
  value={yourChips}
  onRequestAdd={(chip) => handleAddChip(chip)}
  onRequestDelete={(chip) => handleDeleteChip(chip)}
/>

Properties

NameTypeDefaultDescription
styleobjectOverride the inline-styles of the root element.
floatingLabelTextnodeThe content of the floating label.
hintTextnodeThe hint text to display.
disabledboolfalseDisables the chip input if set to true.
defaultValuestring[]The chips to display by default (for uncontrolled mode).
onChangefunctionCallback function that is called when the chips change (in uncontrolled mode).
valuestring[]The chips to display (enables controlled mode if set).
onRequestAddfunctionCallback function that is called when a new chip was added (in controlled mode).
onRequestDeletefunctionCallback function that is called when a new chip was removed (in controlled mode).
dataSourcearrayData source for auto complete.
onUpdateInputfunctionCallback function that is called when the input changes (useful for auto complete).

Additionally, most other properties of Material UI's Auto Complete and Text Field should be supported. Please open an issue if something is missing or does not work as expected.

Credits

The code for the input component was adapted from Material UI's Auto Complete and Text Field that we all know and love.

License

The files included in this repository are licensed under the MIT license.

Keywords

FAQs

Package last updated on 15 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc