Skip to content

ActionSheetRef ​

A reference for all the methods that can be invoked on the action sheet ref.

tsx
import {ActionSheetRef} from 'react-native-actions-sheet';

const ref = useRef<ActionSheetRef>(null);

show ​

Show the action sheet.

ts
ref.current?.show();

hide ​

Hide the action sheet.

ts
ref.current?.hide();

Parameters:

data

The hide function takes an optional data parameter which can be used to return some data to the caller, i.e the function that called SheetManager.show initially.

TypeRequired
anytrue
ts
ref.current?.hide({confirmed: true});

snapToOffset ​

Provide a value between 0 to 100 for the action sheet to snap to.

Parameters:

offset

A value between 0 to 100.

TypeRequired
numbertrue
ts
ref.current?.snapToOffset(20);

snapToIndex ​

When multiple snap points are set on the action sheet, use this to snap it to different position.

Parameters:

index

Snap to the snap point at given index.

TypeRequired
numbertrue
ts
ref.current?.snapToIndex(1);

snapToRelativeOffset ​

Move the action sheet by a percentage relative to its current position. The offset is applied on top of where the sheet currently sits, clamped to the fully-open position.

Parameters:

offset

A relative offset as a percentage (e.g. 10 or -10).

TypeRequired
numbertrue
ts
ref.current?.snapToRelativeOffset(10);

currentSnapIndex ​

Get the current snap index of the sheet.

ts
const index = ref.current?.currentSnapIndex();

isOpen ​

Check if the action sheet is open or closed.

isGestureEnabled ​

Check if the action sheet has gestures enabled or disabled.

keyboardHandler ​

Disable or enable sheet keyboard handler.

ts
ref.current?.keyboardHandler(false);

currentPayload ​

Get the current payload for this action sheet.

Released under the MIT License.