Skip to content

Field: ToggleField

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

Preamble

The ToggleField is an input to switch between two values(true and false), with different labels associated with them.

Properties

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

{
  trueText?: string,
  falseText?: string
}
Name Description Required Default
trueText Text that will be displayed on the button to switch the value to true. ❌ "Yes"
falseText Text that will be displayed on the button to switch the value to false. ❌ "No"

Example

import ToggleFieldfrom '@react-formilicious/bulma/ToggleField';

{
  type: ToggleField,
  key: "newsletter",
  falseText: "No newsletter πŸ‘Ž",
  trueText: <span>πŸ“¨ Subscribe to our <em>awesome</em> newsletter</span>,
  name: "Do you want our newsletter?"
}

Clone this wiki locally