packages/react-components/react-motion/stories/src/Tokens/index.mdx
import { Meta } from '@storybook/addon-docs/blocks'; import { MotionCurves, MotionDuration } from './Cards';
<Meta title="Motion/Tokens" /> <h1 className="sbdocs-title">Motion tokens</h1>Fluent UI React v9 offers predefined tokens for creating custom motions. These tokens can be used as CSS variables or plain JavaScript values, depending on the scenario.
import { createMotionComponent, makeStyles, motionTokens, tokens } from '@fluentui/react-components';
// 💡 Use `tokens` for defining CSS based animations
const useClasses = makeStyles({
root: {
animationDuration: tokens.curveAccelerateMid,
},
});
// 💡 Use `motionTokens` for defining JS based animations
const Motion = createMotionComponent({
duration: motionTokens.curveAccelerateMid,
});
Motion curves are predefined easing functions that can be used to create smooth animations.
<MotionCurves />Motion durations are predefined time values that can be used to create smooth animations.
<MotionDuration />