Skip to content

Field: TagList

Patrick Sachs edited this page Sep 22, 2018 · 1 revision

Preamble

The TagList input is an input to select from a pool of values, and potentially be able to add your own.

Properties

Along with the default element properties this field has the following properties:

{
  tags?: Arraý<string | { id: string, name?: React.ReactNode }>,
  allowCustomTags?: boolean,
  addCustomTagText?: string
}
Name Description Required Default
tags The predefined tags of the field the user can select from. Each tag can either be a string(in which can the string is used as ID and name) or an object with id and name property. []
allowCustomTags If this is true the user can add their own tags in addition to the predefined ones. true
addCustomTagText The text that will be displayed on the button to add a custom tag. "Add a new tag..."

Example

import TagList from '@react-formilicious/bulma/TagList';

{
  type: TagList,
  key: "tags",
  name: "TagList",
  tags: [
    { id: "tag-1", name: "My first tag" },
    { id: "tag-2", name: <span>To <strong>boldly</strong> go where no tag has gone before</span> },
    "tag-3"
  ]
}

Clone this wiki locally