The List Editor component allows the user to add to, delete from, and reorder a list of strings.
Imports
Import React and the ListEditor Component.
0
import * as React from "react";
1
import { ListEditor } from "slate-react-system";
List Editor
Define the List Editor component.
0
class ExampleOne extends React.Component {
13
_handleChange = (e) => {
14
this.setState({ [e.target.name]: e.target.value });
20
placeholder="Add a flavor"
22
options={this.state.flavors}
23
onChange={this._handleChange}
Accepted React Properties
NameTypeDefaultDescription
onChange
function
null
Function called upon an onChange event
options
Array
null
Values to choose from and reorder. Can be used to specify the default value. An array of strings.
label
string
null
Label text
description
string
null
Description text
tooltip
string
null
Tooltip text