Skip to main content

Basic Example

This is a simple example demonstrating how to use the web-scrolling-text React component. The ScrollingText component takes an array of strings and displays them as scrolling text within your application.

With React

App.tsx
import React from "react";
import ScrollingText from "web-scrolling-text/react";

function App() {
return (
<ScrollingText>
{["Hello", "World", "How", "Are", "You"]}
</ScrollingText>
);
}

export default App;

With Next js

for next js use use client on top of the component

App.tsx
"use client";
import React from "react";
import ScrollingText from "web-scrolling-text/react";

function App() {
return (
<ScrollingText>
{["Hello", "World", "How", "Are", "You"]}
</ScrollingText>
);
}

export default App;
info

First element of the array is rendered on server side, Hello is rendered on server