Use <divs/> inside for more structured code and <br/> for breaking lines.
"use client";
import { TextSurf } from "@/components/ui/text-surf";
import Image from "next/image";
export default function Home() {
return (
<TextSurf theme="light" varient="sunshine"
className="text-5xl">
<div>
Lets have some drinks {" "}
<Image
src={"/drinks-3.svg"}
className="relative scale-130 rotate-20"
alt=""
width={45}
height={20}
/>{" "}</div>
<br />
<div>and Takea flight.</div>
</TextSurf>
)};
Pass a scrollContainer when the animation should respond to scrolling within an element instead of the browser window.
"use client";
import { TextSurf } from "@/components/ui/text-surf";
import Image from "next/image";
import { useRef } from "react";
export default function Home() {
const ref = useRef<HTMLDivElement | null>(null);
return (
<div
ref={ref}
className={cn("relative h-90 w-2xl",
"overflow-x-hidden overflow-y-auto")}
>
<TextSurf
scrollContainer={ref}
theme="light"
varient={"ocean"}
duration={0.2}
className="font-myfont w-full text-4xl"
>
<div>
Lets have some drinks <br />
and Takea flight.
</div>....
</TextSurf>
</div>
)};