import { Toggle } from "@progressiveui/react"; () => { return ( <Toggle labelA="Off" labelB="On" name="togglename" /> ); };
boolean
Specify whether the toggle should be on by default
string
Specify the label for the "off" position
Specify the label for the "on" position
(value: boolean,htmlFor: string,event: ChangeEvent<HTMLInputElement>) => void
Provide an optional hook that is called when the control is toggled
Provide an id that unique represents the underlying input
input
Provide an name that unique represents the underlying input
(event: ChangeEvent<HTMLInputElement>) => void
Provide a function that is called when a change event occurs on the control
ReactNode
Provide text that is used alongside the control label for additional help
Provide the text that will be read by a screen reader when visiting this control
Provide a custom className that is applied directly to the underlying <textarea> node
Provide a custom className that is applied directly to the underlying <input> or <textarea> node
Specify whether you want the underlying label to be visually hidden
any
Specify whether the control is currently invalid. Either a boolean in combination with invalidText or an object( eg. { message: "Message", …otherErrorProperties }) can be passed.
invalidText
object
Provide the text that is displayed when the control is in an invalid state
Provide the content that will be shown in addition to the label (e.g. units, currency, etc.) This content will be placed after the label
Specify the placeholder attribute for the input
Specify if the control is required (sets aria-invalid as well)
Specify if the control is disabled (sets aria-disabled as well)
If the input is read-only, the user cannot change its value but focus and tabIndex are still applied (sets aria-readonly as well)
Renders the input as inline element for horizontal forms
Additional helper in front of the input, e.g. a currency symbol (sets aria-describedby as well)
Additional helper behind the input, e.g. a currency symbol (sets aria-describedby as well)
AddonBeforeAddonAfterLabelHelperTextInlineErrorMessage
Supports replacement components