AttachButton

Renders the attachment picker button inside MessageInput. This is the default component for the AttachButton prop.

Best Practices

  • Disable the button when permissions or capabilities are missing.
  • Use handleAttachButtonPress for custom flows instead of bypassing the picker.
  • Avoid heavy work in handleOnPress to keep input responsive.
  • Keep the button visible only when attachments are supported.
  • Use toggleAttachmentPicker to keep state in sync.

Props

disabled

True if channel is frozen and disableIfFrozenChannel is true.

Type
Boolean

handleOnPress

Press handler.

Type
function

handleAttachButtonPress

Customize behavior when the AttachButton is pressed in the message input.

Type
() => void

selectedPicker

Value is images (string), when image attachment picker is open else undefined.

Type
'images' | undefined

toggleAttachmentPicker

Function to toggle attachment picker. By default, this function is attached to onPress handler for AttachButton.

Type
Function