Feature: "isComponentInteractive" utility function #19664
Labels
Fluent UI react-components (v9)
Resolution: Soft Close
Soft closing inactive issues over a certain period
Type: Feature
Milestone
Describe the feature that you would like added
It would be useful to provide a utility function which could standardise whether a component is interactive or not.
What is "interactive"?
For components "interactive" means:
These two aspects are to some degree connected. When the component has some functional behaviour it should represent that visually, at the same time when the component doesn't present itself as interactive users won't expect it to have functionality attached.
Why a utility function?
Ideally we want to standardise the way interactive styles are applied by default, while still giving end users the ability to override it as they see fit. This should cover most use cases with the added flexibility for special cases.
Proposed API
This API counts on an
interactive
prop for components, as well as falling back to looking for standard handlers. If either theinteractive
prop istrue
or at least one of the specified handlers are found the component is deemed interactive and we can apply styles or other behaviour.Handlers
This is a list of handlers that come to my mind when considering interactiveness:
This is probably not a final list for now, but a rough approximation of all the possible event handlers a component could have defined to be considered "interactive" visually.
What component or utility would this be added to
Components such as @fluentui/react-card would benefit from this, as would any where we might need to consider stylistic or functional behaviour based on component interactiveness.
Have you discussed this feature with our team, and if so, who
@andrefcdias
The text was updated successfully, but these errors were encountered: