Skip to content

[Feature]: support of motion params in createPresenceComponent() #31576

Description

@layershifter

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

Currently there is no support for custom params that could be passed from props:

const Scale = createPresenceComponent<{ startFrom?: number }>(({ startFrom = 0.5 }) => {
  const keyframes = [
    { opacity: 0, transform: `scale(${startFrom})` },
    { opacity: 1, transform: 'scale(1)' },
  ];

  /* --- */
});

function App() {
  return <Scale startFrom={0.1} />
}

This makes implementation & usage of motions more tricky & less flexible as all variants should be created statically.

Have you discussed this feature with our team

@robertpenner

Additional context

No response

Validations

  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

Priority

High

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions