Hang on there! We will do a proper launch soon and this is just for testing purposes. 🚀
kinetic-kit
beta

Scroll Transform

A versatile UI element that provides a flexible and customizable way to organize and display menu items within your application.

Usage

Apple style dock

dev

Code

'use client';
import React, { useState, useEffect, useRef } from 'react';
import { motion, useScroll, useTransform } from 'framer-motion';
import Image from 'next/image';
export default function ScrollTransform({
  children,
}: {
  children: React.ReactNode;
}) {
  const container = useRef(null);
  const { scrollYProgress } = useScroll({
    target: container,
    offset: ['start end', 'end start'],
  });
  const y = useTransform(scrollYProgress, [0, 1], ['-6%', '6%']);

  return (
    <div ref={container} className='relative size-full'>
      <motion.div className='relative size-full' style={{ y }}>
        {children}
      </motion.div>
    </div>
  );
}

Component API

ScrollTransform

PropTypeDefaultDescription
childrenReactNodeThe content to display in the button.
asChildbooleanfalseReplaces the button tag with the provided child.
iconReactElement<ArrowBigRight size={28} />Colors for the waves that animate on hover.
prependIconbooleanfalseThe visual style of the button.
size'default' | 'large''default'The size of the button, with 'large' being bigger.
refRef<Button or Link Element>Provides a reference to the button or link DOM element, depending on asChild.