Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
import { InputSelectionHandler} from 'empower-inputs';

let [formElement, setFormElement] = useState({
sampleToggleButton: {
      id: 'sampleToggleButton',
      type: 'toggle-button',
      placeholder: 'Please select option',
      value: '',
      disabled: false,
      required: true,
      options: [
          {
            label: "Approve",
            value: "APPROVED",
          },
          {
            label: "Reject",
            value: "REJECTED",
          }
        ]
    }
    
});

..............

return (
    <>
      <h4>TOGGLE BUTTON</h4>
      <InputSelectionHandler
        config={formElement.sampleToggleButton}
        customClass="toggle-button-custom-class"
        onChanged={(e: any) => inputChangedHandler(e, 'sampleToggleButton')}
      />
    </>
  )

...