mui / mui/base-ui

[combobox] An example for Custom value to be rendered inside Combobox

Open
#2,759 3 comments 0 reactions 0 assignees View on GitHub
component: combobox support: question
Dominant language
TypeScript
Stars
10.9k
Forks
543
Avg merge
1d 20h
Merged PRs (30d)
101

Description

### Support needed
Input inside trigger example, something like React Select.

## Use Case
I want to use Combobox to build a component where consumers can render custom content as the selected value (e.g., a person's avatar with their name, product images with titles, etc.). This is similar to how React Select allows custom `SingleValue` components.

Currently, the default examples in the docs don't address this use case for single-select scenarios.

## Current Challenge
When trying to implement this pattern, I'm running into architectural issues with how to structure the trigger and input elements:

### Approach 1: Input inside Trigger (causes event conflicts)
```jsx

{/* Input clicks bubble to trigger, causing open/close flickering */}

```

### Approach 2: Multiple separate triggers (workaround)
```jsx







```

### Expected behavior:
- No selection: Show input with placeholder, clicking anywhere opens popup
- With selection: Show custom selected value, clicking anywhere opens popup and focuses input
- While typing: Hide selected value, show input for filtering
- The input does not retain the value of the selected item.

### Questions for the Team

- What's the recommended pattern for implementing custom selected value displays with React select like behavior?

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.