TagFormModal

TagFormModal is a React component that displays a modal form that can be used to create a new tag or update an existing tag. The form works in the "create" or "update" mode depending on its properties.

"Create" mode

:arrow-right: View the demo

"Update" mode

:arrow-right: View the demo

Usage

<TagFormModal/>
<TagFormModal
  tag={{
    id: 'ea837e28-509b-4b6a-a600-d54b6aa0b1f5',
    name: 'Existing tag'
  }}
/>

Properties

onClose: function

Callback. Triggered when the modal form is closed, for example, after clicking the "Cancel" button or after successful tag creation or update.

onCreate: function

Callback. Triggered after successful tag creation or update.

tag: object

Contains two fields:

  • id - the ID of an existing tag those name you want to change.
  • name - the old tag name to display in the prompt.