Grapes homepage1.57.0
  • Guide
  • Tokens
  • Components
    Grapes on GithubGrapes on Figma
    Interaction
    • Button
    • IconButton
    • FloatingActionBar
    • Link
    Icons
    • Icon
    • HighlightIcon
    Form
    • AmountInput
    • Autocomplete
    • AutocompleteMultiple
    • AutocompletePlace
    • CheckboxBox
    • CheckboxField
    • DatePicker
    • FormField
    • Input
    • OptionGroup
    • PasswordInput
    • PhoneInput
    • RadioBox
    • RadioField
    • RadioGroup
    • Select
    • SwitchField
    • TextArea
    • TextInput
    • Upload
    • UploadButton
    Feedback
    • Badge
    • Banner
    • Callout
    • EmptyState
    • Modal
    • ModalSlideshow
    • DeprecatedModalSlideshow
    • PageModal
    • Skeleton
    • Tag
    • Toast
    • Tooltip
    Data display
    • Accordion
    • Avatar
    • Box
    • Calendar
    • CalendarRange
    • CollapsibleList
    • FileCard
    • InfoTip
    • ListBox
    • ListView
    • Panel
    • SidePanel
    • DeprecatedPreview
    • Table
    • Timeline
    • useDateFormatter
    Navigation
    • DropdownItem
    • DropdownMenu
    • Navigation
    • NavigationItem
    • Popover
    • Tabs

    SwitchField

    The SwitchField is a type of checkbox that represents on/off values.

    View source code
    • Usage
    • Props
    • Accessibility
    • isChecked
      boolean

      Whether the SwitchInput should be checked

    • label
      ReactNode

      Content to render as the SwitchInput's label

    • onChange
      ChangeEventHandler<HTMLInputElement>

      Handler called when the SwitchInput's state changes

    • className
      string

      className for the element

    • fit
      "content" | "parent"

      Whether the input should fit the content or the parent. Default to content

      Default: content
    • helpText
      ReactNode

      Content to render as the SwitchInput's help text

    • id
      string

      The element's unique identifier

    • isDisabled
      boolean

      Whether the input is disabled. Default to false

      Default: false
    • name
      string

      Name of the input element

      Default: