Animated Testimonials

Minimal testimonials sections with image and quote.

Table of contents

PR

Installation

To install, just include the following JavaScript somewhere on your page:

<!-- Load the core file first -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/ft-core.iife.js"
></script>
<!-- Load the component -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/ft/animated-testimonials.iife.js"
></script>

Important notes

  • Make sure your project is using either Frankenstyle or FrankenstyleKit.
  • The order of JavaScript loading is important. The ft-core.iife.js file must be loaded before any other components.
  • When using multiple Frankternity components, the core file only needs to be loaded once.

CSS variables

All CSS variables prefixed with --ft-* can be used to customize layout, spacing, colors, and sizing of this component.

Container

VariableDefaultDescription
--ft-container-px4Horizontal padding on the container
--ft-container-py20Vertical padding on the container
--ft-container-md-px8Horizontal padding on medium screens
--ft-container-lg-px12Horizontal padding on large screens

Grid layout

VariableDefaultDescription
--ft-grid-gap20Gap between grid items
--ft-grid-cols1Number of grid columns on small screens
--ft-grid-cols-md2Number of grid columns on medium screens

Image

VariableDefaultDescription
--ft-image-height80Height of the testimonial image container

Content spacing

VariableDefaultDescription
--ft-content-py4Vertical padding for the content section
--ft-quote-mt8Top margin above the quote text

Text colors

VariableDefaultDescription
--ft-designation-colorvar(--color-gray-500)Color of the designation text
--ft-designation-color-darkvar(--color-neutral-500)Designation color in dark mode
--ft-quote-colorvar(--color-gray-500)Quote text color
--ft-quote-color-darkvar(--color-neutral-300)Quote text color in dark mode

Buttons layout

VariableDefaultDescription
--ft-button-gap4Gap between navigation buttons
--ft-button-pt12Top padding above buttons
--ft-button-md-pt0Top padding above buttons on medium screens

Buttons styling

VariableDefaultDescription
--ft-button-size7Width and height of navigation buttons
--ft-button-bgvar(--color-gray-100)Button background color
--ft-button-bg-darkvar(--color-neutral-800)Button background color in dark mode

Button icons

VariableDefaultDescription
--ft-button-icon-size5Width and height of button icons
--ft-button-icon-colorvar(--color-black)Button icon color
--ft-button-icon-color-darkvar(--color-neutral-400)Button icon color in dark mode
--ft-button-transition-duration300Transition duration for button hover animations (ms)

Props

To pass props, include them as JSON inside a <script> tag with the data-fn="props" attribute.

Note The data-ft-* attribute determines which Frankternity component is mounted and should be replaced with the component name.

Prop NameTypeRequiredDefaultDescription
testimonialsArray<{ quote: string; name: string; designation: string; src: string }>Yes-Array of testimonial objects containing the quote, author name, designation, and image source URL
autoplaybooleanNofalseWhether to automatically cycle through testimonials every 5 seconds

Testimonial object shape

Each object in the testimonials array should have the following properties:

PropertyTypeDescription
quotestringThe testimonial text
namestringThe name of the person giving the testimonial
designationstringThe title or role of the person
srcstringThe URL of the person’s image