@yamada-ui/transitions
Version:
Yamada UI transitions components
80 lines (77 loc) • 1.99 kB
TypeScript
import * as _yamada_ui_motion from '@yamada-ui/motion';
import { MotionProps } from '@yamada-ui/motion';
import { ThemeProps } from '@yamada-ui/core';
import { Merge } from '@yamada-ui/utils';
import { ReactElement } from 'react';
type AiryIdent = "from" | "to";
interface AiryOptions {
/**
* Passing React elements to "from" is required.
*/
from: ReactElement;
/**
* Passing React elements to "to" is required.
*/
to: ReactElement;
/**
* You can set the initial state.
*
* @default 'from'
*/
defaultValue?: AiryIdent;
/**
* The animation delay.
*
* @default 0
*/
delay?: number;
/**
* If `true`, the component is disabled.
*
* @default false
*/
disabled?: boolean;
/**
* The animation duration.
*
* @default 0.2
*/
duration?: number;
/**
* If `true`, the component is disabled.
*
* @default false
* @deprecated Use `disabled` instead.
*/
isDisabled?: boolean;
/**
* If `true`, the component is readonly.
*
* @default false
* @deprecated Use `readOnly` instead.
*/
isReadOnly?: boolean;
/**
* If `true`, the component is readonly.
*
* @default false
*/
readOnly?: boolean;
/**
* Use this when you want to control the animation from outside the component.
*/
value?: AiryIdent;
/**
* This is a callback function that is called when the animation state changes.
*/
onChange?: (value: AiryIdent) => void;
}
interface AiryProps extends Merge<MotionProps<"button">, AiryOptions>, ThemeProps<"Airy"> {
}
/**
* `Airy` is a component that creates an airy animation, switching between two elements when one is clicked.
*
* @see Docs https://yamada-ui.com/components/transitions/airy
*/
declare const Airy: _yamada_ui_motion.MotionComponent<"button", AiryProps>;
export { Airy, type AiryIdent, type AiryProps };