microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
18.52k stars 2.73k forks source link

[Feature]: Dropdown Item uses Avatar component #22892

Closed kailunh closed 2 years ago

kailunh commented 2 years ago

Library

React Northstar / v0 (@fluentui/react-northstar)

Describe the feature that you would like added

When using the dropdown component, the dropdown item only take an url for its image. However, if we can use the avatar component instead of an image url here, we can have a default avatar with user's initial when there are no image. For the current dropdown, a bad url will lead a broken avartar here.

Have you discussed this feature with our team

No response

Additional context

image image

Validations

gouttierre commented 2 years ago

@jurokapsiar - would you and your team be able to review this feature request? Thank you

jurokapsiar commented 2 years ago

Hi, it is possible to replace any slot using children props: https://codesandbox.io/s/fluent-ui-example-forked-pcsfdj?file=/example.js

See documentation about slot render callback for details: https://fluentsite.z22.web.core.windows.net/0.64.0/shorthand-props#using-render-props