All Projects → TeamWertarbyte → Material Ui Chip Input

TeamWertarbyte / Material Ui Chip Input

Licence: mit
A chip input field using Material-UI.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Material Ui Chip Input

Materialchipview
Material Chip view. Can be used as tags for categories, contacts or creating text clouds
Stars: ✭ 1,181 (+70.91%)
Mutual labels:  chip, material-design, material-ui
Material Ui Password Field
A password field using Material-UI.
Stars: ✭ 54 (-92.19%)
Mutual labels:  material-design, material-ui, input
Purpleadmin Free Admin Template
Purple Admin is one of the most stylish Bootstrap admin dashboard you can get hands on. With its beautifully crafted captivating design and well-structured code.
Stars: ✭ 473 (-31.55%)
Mutual labels:  material-design, material-ui
Materialpreferences
A highly flexible set of lovely looking views that provides functionality of preferences.
Stars: ✭ 495 (-28.36%)
Mutual labels:  material-design, material-ui
Android Iconics
Android-Iconics - Use any icon font, or vector (.svg) as drawable in your application.
Stars: ✭ 4,916 (+611.43%)
Mutual labels:  material-design, material-ui
Vue Material Dashboard
Vue Material Dashboard - Open Source Material Design Admin
Stars: ✭ 403 (-41.68%)
Mutual labels:  material-design, material-ui
Materialtimelineview
With MaterialTimelineView you can easily create a material looking timeline.
Stars: ✭ 443 (-35.89%)
Mutual labels:  material-design, material-ui
Hexo Theme One
hexo单页面炫酷主题
Stars: ✭ 522 (-24.46%)
Mutual labels:  material-design, material-ui
Spectro
🎶 Real-time audio spectrogram generator for the web
Stars: ✭ 383 (-44.57%)
Mutual labels:  material-design, material-ui
Alerter
An Android Alerting Library
Stars: ✭ 5,213 (+654.41%)
Mutual labels:  material-design, material-ui
Introviews Flutter
☀️ A Flutter package for some material design app intro screens with some cool animations.
Stars: ✭ 570 (-17.51%)
Mutual labels:  material-design, material-ui
Android Material Design For Pre Lollipop
Various UI implementations, animations & effects based on Material Design compatible with pre Lollipop devices as well. (Work in progess)
Stars: ✭ 585 (-15.34%)
Mutual labels:  material-design, material-ui
Material Auto Rotating Carousel
Introduce users to your app with this Material-style carousel.
Stars: ✭ 400 (-42.11%)
Mutual labels:  material-design, material-ui
Rally
Unofficial Implementation of Material Studies https://material.io/design/material-studies/rally.html
Stars: ✭ 392 (-43.27%)
Mutual labels:  material-design, material-ui
React Phone Input 2
📞 Highly customizable phone input component with auto formatting
Stars: ✭ 446 (-35.46%)
Mutual labels:  material-ui, input
Md2
Angular2 based Material Design components, directives and services are Accordion, Autocomplete, Collapse, Colorpicker, Datepicker, Dialog(Modal), Menu, Multiselect, Select, Tabs, Tags(Chips), Toast and Tooltip.
Stars: ✭ 389 (-43.7%)
Mutual labels:  chip, material-design
Mcg
Material Design Palette/Theme Generator - AngularJS, React, Ember, Vue, Android, Flutter & More!
Stars: ✭ 507 (-26.63%)
Mutual labels:  material-design, material-ui
Springboot Starterkit
Starter Kit for Spring Boot based (REST APIs and WebMVC) micro services.
Stars: ✭ 596 (-13.75%)
Mutual labels:  material-design, material-ui
Aestheticdialogs
📱 An Android Library for 💫fluid, 😍beautiful, 🎨custom Dialogs.
Stars: ✭ 352 (-49.06%)
Mutual labels:  material-design, material-ui
Library Assistant
Modern Library Management Software using JavaFX
Stars: ✭ 380 (-45.01%)
Mutual labels:  material-design, material-ui

material-ui-chip-input

Build Status Coverage Status

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 [email protected]

Note: This is the version for Material-UI 1.0.0 or later. If you are still using Material-UI 0.x, you can use our legacy version.

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}
  onAdd={(chip) => handleAddChip(chip)}
  onDelete={(chip, index) => handleDeleteChip(chip, index)}
/>

Properties

Name Type Default Description
allowDuplicates bool false Allows duplicate chips if set to true.
alwaysShowPlaceholder bool If true, the placeholder will always be visible.
blurBehavior enum 'clear' Behavior when the chip input is blurred: 'clear' clears the input, 'add' creates a chip, 'add-or-clear' either creates a chip or clears the input on failure (see: onBeforeAdd), and 'ignore' keeps the input.
chipRenderer func A function of the type ({ value, text, chip, isFocused, isDisabled, isReadOnly, handleClick, handleDelete, className }, key) => node that returns a chip based on the given properties. This can be used to customize chip styles. Each item in the dataSource array will be passed to chipRenderer as arguments chip, value and text. If dataSource is an array of objects and dataSourceConfig is present, then value and text will instead correspond to the object values defined in dataSourceConfig. If dataSourceConfig is not set and dataSource is an array of objects, then a custom chipRenderer must be set. chip is always the raw value from dataSource, either an object or a string.
clearInputValueOnChange bool false Whether the input value should be cleared if the value prop is changed.
dataSource array Data source for auto complete. This should be an array of strings or objects.
dataSourceConfig shape Config for objects list dataSource, e.g. { text: 'text', value: 'value' }. If not specified, the dataSource must be a flat array of strings or a custom chipRenderer must be set to handle the objects.
defaultValue array The chips to display by default (for uncontrolled mode).
delayBeforeAdd bool false Use setTimeout 150ms delay before adding chips in case other input callbacks like onSelection need to fire first.
disabled bool Disables the chip input if set to true.
disableUnderline bool false If true, the input will not have an underline.
FormHelperTextProps object Props to pass through to the FormHelperText component.
fullWidth bool If true, the chip input will fill the available width.
fullWidthInput bool If true, the input field will always be below the chips and fill the available space. By default, it will try to be beside the chips.
helperText node Helper text that is displayed below the input.
InputLabelProps object Props to pass through to the InputLabel.
InputProps object Props to pass through to the Input.
inputRef func Use this property to pass a ref callback to the native input component.
inputValue string The input value (enables controlled mode for the text input if set).
label node The content of the floating label.
newChipKeyCodes arrayOf [13] The key codes (KeyboardEvent.keyCode) used to determine when to create a new chip.
newChipKeys arrayOf ['Enter'] The keys (KeyboardEvent.key) used to determine when to create a new chip.
onAdd func Callback function that is called when a new chip was added (in controlled mode).
onBeforeAdd func Callback function that is called with the chip to be added and should return true to add the chip or false to prevent the chip from being added without clearing the text input.
onChange func Callback function that is called when the chips change (in uncontrolled mode).
onDelete func Callback function that is called when a new chip was removed (in controlled mode).
onUpdateInput func Callback function that is called when the input changes.
placeholder string A placeholder that is displayed if the input has no values.
readOnly bool Makes the chip input read-only if set to true.
value array The chips to display (enables controlled mode if set).
variant enum 'standard' Sets the variant for the input. Values 'standard', 'outlined', 'filled'

Any other properties supplied will be spread to the root element. The properties of <FormControl /> are also available.

CSS API

You can customize the class names used by ChipInput with the classes property. It accepts the following keys:

  • root
  • inputRoot
  • input
  • chipContainer
  • label
  • helperText
  • chip

Have a look at this guide for more detail.

Credits

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

License

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].