MultipleTextInput

Type: React component

How to get MultipleTextInput?

JavaScript

import { MultipleTextInput } from 'fds/components';

Renders a TextInput, adding the functionality to input multiple values. For each value in the values array a chip is rendered, allowing it to be removed by clicking the remove icon within the chip.

Props

  1. addButtonLabel

    (Optional)

    Type: String

    The human readable label for the "add" button.

    Default value

  2. isDisabled

    (Optional)

    Type: Boolean

    Whether or not the component should be rendered in a disabled state.

    Default value

  3. name

    (Optional)

    Type: String

    The name of this component to identify it (and its value) when used inside an intelligent container component which aggregates its children (and/or their values), like a Form.

    Default value

  4. onChange

    (Optional)

    Type: Function

    A callback that is called whenever a component's value changes.

    This callback is called just before the "validate" prop is called.

    Use this callback to update local state which in turn should update the value prop of the component whose callback just fired.

    Arguments

    Default value

  5. placeholder

    (Optional)

    Type: String

    The placeholder text displayed in component when it is empty, i.e. has no values.

    Default value

  6. tooltipContent

    (Optional)

    Type: String | ReactElement

    The content of the tooltip that is displayed when hovering over the whole component.

    • string: the textual content of the tooltip

    • ReactElement: a React Element (instance of a React Component, usually created with JSX)

    Default value

  7. validate

    (Optional)

    Type: Function

    A callback that is called directly after the value(s) of a form component change(s).

    Use this callback to check the selected value(s) against business rules and to set any feedback for the user based on this.

    Arguments

    Returns

    Default value

  8. values

    (Required)

    Type: Array<String>

    The current value of the component. This value should be a valid string.

    Default value