Skip to content

BooleanInput

Toggle switch for boolean values, leveraging shadcn’s Switch component.

import { BooleanInput } from '@/components/admin';
<BooleanInput source="is_published" />
PropRequiredTypeDefaultDescription
sourceRequiredstring-Field name
classNameOptionalstring-Wrapper classes
defaultValueOptionalbooleanfalseInitial value
disabledOptionalboolean-Disable control
formatOptionalfunction-Callback taking the value from the form state, and returning the input value.
helperTextOptionalReactNode-Help text
labelOptionalstringInferredLabel text
parseOptional-Callback taking the value from the input, and returning the value to be stored in the form state.
validateOptionalValidator | Validator[]-Validation