mui / mui/base-ui

[drawer] Feature request: adding payload to certain Drawer.SwipeArea for modularity

Open
#4,908 0 comments 0 reactions 0 assignees View on GitHub
component: drawer type: new feature
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

# Feature request

## Summary
- When Drawer.SwipeArea is triggered, is it possible to pass payload such as if using custom handle and payload in triggers?
Currently SwipeArea only triggers undefined payload

```
export const customHandle = Drawer.createHandle();
customHandle.openWithPayload("drawer screen 1");
customHandle.openWithPayload("drawer screen 2");
customHandle.openWithPayload("drawer screen 3");

...

{({ payload }) => {
if (payload === 'drawer screen 1') return

drawer screen 1


if (payload === 'drawer screen 2') return

drawer screen 2


if (payload === 'drawer screen 3') return

drawer screen 3


}}

```

## Examples in other libraries

## Motivation

If I have a shelf/fridge/pantry feature in a Grocery app, it'd be useful to open specific shelves/pantry drawer/fridge space

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.