Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ interface User {
- `statusBarTranslucent: true` - Required on Android for correct keyboard height calculation when status bar is translucent (edge-to-edge mode)
- `navigationBarTranslucent: true` - Required on Android for correct keyboard height calculation when navigation bar is translucent (edge-to-edge mode)
- **`keyboardAvoidingViewProps`** _(Object)_ - Props to be passed to the [`KeyboardAvoidingView`](https://kirillzyusko.github.io/react-native-keyboard-controller/docs/api/components/keyboard-avoiding-view). See **keyboardVerticalOffset** below for proper keyboard handling.
- **`keyboardBottomOffset`** _(Number)_ - Extra bottom offset (in pixels) for the KeyboardAvoidingView. Useful on Android when using expo-router or other navigation setups where the keyboard may still cover the input toolbar even with correct `keyboardVerticalOffset`. Default is `0`. Example: `keyboardBottomOffset={50}` adds 50px of extra bottom padding to push the input above the keyboard.
- **`isAlignedTop`** _(Boolean)_ Controls whether or not the message bubbles appear at the top of the chat (Default is false - bubbles align to bottom)
- **`isInverted`** _(Bool)_ - Reverses display order of `messages`; default is `true`

Expand Down
8 changes: 7 additions & 1 deletion src/GiftedChat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ function GiftedChat<TMessage extends IMessage = IMessage> (
renderInputToolbar,
isInverted = true,

// Keyboard offset
keyboardBottomOffset = 0,

// Reply props
reply,
} = props
Expand Down Expand Up @@ -330,7 +333,10 @@ function GiftedChat<TMessage extends IMessage = IMessage> (
<KeyboardAvoidingView
behavior='translate-with-padding'
keyboardVerticalOffset={insets.top}
style={stylesCommon.fill}
style={[
stylesCommon.fill,
keyboardBottomOffset > 0 && { paddingBottom: keyboardBottomOffset },
]}
{...props.keyboardAvoidingViewProps}
>
<View style={[stylesCommon.fill, !isInitialized && styles.hidden]}>
Expand Down
9 changes: 9 additions & 0 deletions src/GiftedChat/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,15 @@ export interface GiftedChatProps<TMessage extends IMessage> extends Partial<Omit
keyboardProviderProps?: React.ComponentProps<typeof KeyboardProvider>
/** Props for KeyboardAvoidingView. Use `keyboardVerticalOffset` to account for headers or iOS predictive text bar (~44pt). */
keyboardAvoidingViewProps?: KeyboardAvoidingViewProps
/**
* Extra bottom offset (in pixels) for the KeyboardAvoidingView.
* Useful on Android when using expo-router or other navigation setups where the
* keyboard may cover the input toolbar. Default is 0.
* On iOS, this adds to the keyboard vertical offset calculation.
* On Android, this can compensate for cases where the keyboard avoiding behavior
* does not properly account for the full keyboard height.
*/
keyboardBottomOffset?: number
/** Enable animated day label that appears on scroll; default is true */
isDayAnimationEnabled?: boolean

Expand Down