Skip to main content

useCheckboxField

Field hook to access the data of a configurable field with the type checkbox.

Arguments

The hook can take an object as argument with the following properties.

FieldTypeDescription
fieldstringThe name of the field

Returns

The boolean that the user switched the checkbox to.

Example

src/widgets/example/Example.tsx
import React from 'react'
import {useCheckboxField} from '@modbros/dashboard-sdk'

export default function Example() {
const isChecked: boolean | null = useCheckboxField({field: 'example'})

return null
}