testimonialslider
v1.0.6
Published
A Reusable React Testimonial Slider Component
Downloads
440
Maintainers
Readme
Testimonial Slider Component
A reusable React component for displaying testimonials in a slider format.
Installation
npm install testimonial-slider
Usage
Import the component and pass in your testimonials as a prop:
import Testimonial from "testimonial-slider";
import bgImage from "./path/to/your/background/image.jpg";
const testimonials = [
{
img: "path/to/image1.jpg",
name: "John Doe",
content: "This is a fantastic service!",
},
{
img: "path/to/image2.jpg",
name: "Jane Smith",
content: "Highly recommend!",
},
// Add more testimonials as needed
];
<Testimonial testimonials={testimonials} bgImage={bgImage} />;
Props
Testimonials (required)
An array of testimonial objects. Each object should contain:
- img: String - The image path or URL for the person’s picture.
- name: String - The name of the person giving the testimonial.
- content: String - The testimonial text.
bgImage (optional)
- A string representing the background image URL or path.
Example:
const testimonials = [
{
img: "https://example.com/image1.jpg",
name: "Alice",
content: "Great service!",
},
{
img: "https://example.com/image2.jpg",
name: "Bob",
content: "Highly recommend!",
},
];
<Testimonial
testimonials={testimonials}
bgImage="https://example.com/bg.jpg"
/>;