width | Width of the component note: You can also set the width using "className", "style", etc. instead of using this property example: 100, '200px', '10rem', '20%' | - |
height | Height of the component note: You can also set the height using "className", "style", etc. instead of using this property example: 100, '200px', '10rem', '20%' | - |
borderRadius | Border radius of the component (applied to glare elements as well) example: '4px', '1em', '2rem' | - |
perspective | Determines how far the elements are from the user example: '1000px', '60em', '50rem' | "1000px" |
scale | Amount of scale applied to the component on hover/touch | 1 |
shadowEnable | Enables/Disables the shadow applied to the container or tilt element on hover/touch | false |
shadow | The shadow applied to the container or tilt element on hover/touch | "0 0 1rem rgba(0,0,0,0.5)" |
shadowType | Type of the shadow applied on hover/touch If set to 'box' , shadow is applied as box-shadow to the tilt element If set to 'drop' , shadow is applied as filter: drop-shadow() to the container element note: Set to 'drop' if you have a setup where elements go outside the tilt element and want to apply the shadow to them as well, Or if you have multiple elements inside the tilt element and want the shadow to apply to them individually and not the whole tilt element | "box" |
lineGlareEnable | Enables/Disables the line glare effect | true |
lineGlareBlurEnable | Enables/Disables the blur applied to the line glare effect | true |
lineGlareBlurAmount | Amount of blur applied to the line glare effect example: '4px', '1em', '2rem' | "4px" |
lineGlareWidthPercent | Width of the line glare in relation to the component | 10 |
lineGlareMaxOpacity | Maximum opacity of the line glare effect | 0.1 |
lineGlareMixBlendMode | mix-blend-mode applied to the line glare effect
note: Using a "mix-blend-mode" other than "normal" will break the parallax effect string (Property.MixBlendMode)
| "normal" |
lineGlareColor | Color of the line glare effect example: 'lightblue', '#445566AA', 'rgba(50,150,250,0.5)', 'hsla(100,50%,50%,0.2)' | "white" |
lineGlareReverse | Reverses the movement of the line glare effect | false |
lineGlareDirection | Changes the direction/angle of the line glare effect "to-bottom-right" | "to-bottom-left"
| "to-bottom-right" |
lineGlareHoverPosition | Determines the areas of the component that show the line glare effect when hovered/touched "top-left" | "top-right" | "bottom-left" | "bottom-right"
| "top-left" |
|
lineGlareFixedPosition | Sets the position of the line glare element to a fixed position inside the component. note: The position determines the center of the line glare element. The left property can be specified in pixels ('px') or percentage ('%'). When set, the line glare element will not respond to hover/touch and will always be at the specified position. "left" | "right" | "center" | { left: `${number}px` | `${number}%`; }
| - |
spotGlareEnable | Enables/Disables the spot glare effect | true |
spotGlareSizePercent | Size of the spot glare effect in relation to the component between 0 to Infinity note: If spotGlarePosition is set to anything other than 'all' , only half of the spot glare effect is visible at any time. That's why the default value is 200 to cover the whole element. | 200 |
spotGlareMaxOpacity | Maximum opacity of the spot glare effect | 0.5 |
spotGlareMixBlendMode | mix-blend-mode applied to the spot glare effect
note: Using a "mix-blend-mode" other than "normal" will break the parallax effect string (Property.MixBlendMode)
| "normal" |
spotGlarePosition | Determines the position of the spot glare effect inside the component "top" | "right" | "bottom" | "left" | "all"
| "top" |
spotGlareColor | Color of the line glare effect example: 'lightblue', '#445566AA', 'rgba(50,150,250,0.5)', 'hsla(100,50%,50%,0.2)' | "white" |
spotGlareReverse | Reverses the movement of the spot glare effect | false |
spotGlareFixedPosition | Sets the position of the spot glare element to a fixed position inside the component. note: The position determines the center of the spot glare element. The left and top properties can be specified in pixels ('px') or percentage ('%'). When set, the spot glare element will not respond to hover/touch and will always be at the specified position. "top-left" | "top-right" | "bottom-left" | "bottom-right" | "center" | { left: `${number}px` | `${number}%`; top: `${number}px` | `${number}%`; }
| - |
tiltMaxAngleX | Maximum tilt angle around the X axis between 0 to 90 note: Setting to 0 will disable rotation around the X axis | 20 |
tiltMaxAngleY | Maximum tilt angle around the Y axis between 0 to 90 note: Setting to 0 will disable rotation around the Y axis | 20 |
tiltReverse | Reverses the tilt direction/movement | false |
tiltReset | Enables/Disables resetting the tilt effect on mouseLeave/touchEnd | true |
initialAngleX | Initial tilt/rotation angle around the X axis note: Is limited to [-tiltMaxAngleX - tiltMaxAngleX] range | - |
initialAngleY | Initial tilt/rotation angle around the Y axis note: Is limited to [-tiltMaxAngleY - tiltMaxAngleY] range | - |
disableScrollOnTouch | Disables scrolling (overflow: hidden ) during touch inetraction to prevent unwanted movement note: Disables scrolling on "body" if set to "boolean". You can also pass an "HTMLElement" which scrolling will be disabled for, instead of "body" | true |
style | Style passed to the component's container element | - |
tiltStyle | Style passed to the component's tilt element | - |
|
tiltClass | className passed to the component's tilt element | - |
tiltProps | Properties passed to the tilt element HTMLAttributes<HTMLDivElement> & { [data: `data-${string}`]: string; }
| - |
gyroMaxAngleX | Maximum tilt angle around the X axis for gyroscope between 0 to 90 note: Setting to 0 will disable rotation around the X axis for gyroscope | 0 |
gyroMaxAngleY | Maximum tilt angle around the Y axis for gyroscope between 0 to 90 note: Setting to 0 will disable rotation around the Y axis for gyroscope | 0 |
gyroReverse | Reverses the tilt direction for gyroscope | false |
disabled | Disables the tilt effect and applies the disabledFilter to the container | false |
disabledFilter | CSS filter applied to the container when disabled = true | "grayscale(1) brightness(125%)" |
CSSTransition | CSS transition applied to the tilt, line glare, and spot glare elements string
| "all 0.4s cubic-bezier(0.03, 0.98, 0.52, 0.99)" |
TiltWrapper | Component wrapping the tilt element note: Is useful when integrating this component into another component FC<{ children?: ReactNode; }>
| ({ children }: PropsWithChildren) => <>{children}</> |
fullPageListening | Enables/Disables full-page listening. This component's event handlers will be added to the "document" ote: If set to "true", "controlElement", "controlElementOnly", and "disableScrollOnTouch" properties will have no effect boolean
| false |
controlElement |
Element(s) that control(s) this component. This component's event handlers will be added to them note: You can pass an HTMLElement, a ref, or an array of them This property will have no effect if "fullPageListening" is set to "true" example: element, ref, [element, ref], [ref1, ref2] HTMLElement | RefObject<unknown> | (HTMLElement | RefObject<unknown>)[]
| - |
controlElementOnly | If set to "true", events will be disabled for the component and it will be controlled by the controlElement(s) only This property will have no effect if "fullPageListening" is set to "true" boolean
| false |
preserve3dEnable | If set to true, adds transform-style: preserve-3d; to the container and tilt elements note: Enable if you want to set up a parallax effect and translate elements along the Z axis Disable if you are having problems with blur warning: Can cause blur on scale (prevents re-rastering at higher scales by Chrome's compositor and the element is always rasterized at scale 1) | true |
testIdEnable | Adds the data-testid=... property to all elements for testing purposes note: Can also be used to select/grab and modify each element if you want to do heavy customization | false |