You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am just sharing the idea of better implementation of the existing component. The way below we have more control of the value to the children div or components. Hence we no need to create extra state to save the progress value etc. The methods below can be found in many packages or headless components such as headless tailwind ui, rainbowkit
children({...props}) allow to pass any properties and value to the children directly.
<Scrollytelling.Root
// start="top top"
// end="bottom bottom"
scrub={1}
debug={true}
>
<Scrollytelling.Animation
tween={{
start: 0,
end: 55,
}}
>
{({ progress, ...props }) => {
return (
<div>
// assume i always need to pass the progress and props to deep nested children
<motion.div
{...props}
className="absolute inset-0 bg-gradient-to-b from-sky-50 to-sky-100 opacity-100"
style={{ opacity: progress }}
>
Test opacity progress
</motion.div>
</div>
);
}}
</Scrollytelling.Animation>
</Scrollytelling.Root>
The text was updated successfully, but these errors were encountered:
liho00
changed the title
Suggest of better implementation of headless component
[Feature Request] A better implementation of headless component
Aug 6, 2023
I am just sharing the idea of better implementation of the existing component. The way below we have more control of the value to the children div or components. Hence we no need to create extra state to save the progress value etc. The methods below can be found in many packages or headless components such as headless tailwind ui, rainbowkit
children({...props})
allow to pass any properties and value to the children directly.The component below direct provide the value to its children components without creating extra state or create global state outside the component.
Current Behavior:
Expected Result:
The text was updated successfully, but these errors were encountered: