search results:

    • Standard
    • React
    Pricing Learn Community
    • + D
    • Light
    • Dark
    • System
    logo TW Elements
    • Getting started
      • Quick start
      • Dark mode
      • Theming
      • Changelog
    • CommercialNew
      • Pricing
      • License
      • Installation
      • Git & repository
      • Premium Support
    • Integrations
      • Next
    • Content & styles
      • Animations
      • Animations extended
      • Colors
      • Dividers
      • Figures
      • Headings
      • Hover effects
      • Icons
      • Images
      • Mask
      • Shadows
      • Typography
    • Navigation
      • Breadcrumbs
      • Footer
      • Pagination
      • Pills
      • Tabs
    • Components
      • Accordion
      • Alerts
      • Avatar
      • Badges
      • Button group
      • Buttons
      • Cards
      • Carousel
      • Collapse
      • Dropdown
      • Link
      • List group
      • Modal
      • Paragraphs
      • Placeholders
      • Popover
      • Progress
      • Rating
      • Scroll back to top button
      • Social buttons
      • Spinners
      • Timeline
      • Toasts
      • Tooltip
      • Video carousel
    • Forms
      • Checkbox
      • File input
      • Form templates
      • Inputs
      • Login form
      • Radio
      • Range
      • Registration form
      • Search
      • Select
      • Switch
      • Textarea
    • Data
      • Charts
      • Tables
    • Methods
      • Ripple
    • ResourcesNew
      • Playground
      • YouTube Channel
      • Private FB Group
      • Newsletter
      • UI Design course New

    Hover effects

    Tailwind CSS React Hover Effects

    Responsive hover effects built with Tailwind CSS. Hover effect appears when the user positions the computer cursor over an element without activating it.


    Basic example

    Hover effect appears when a user positions computer cursor over an element without activating it.

    Loading...
    • JSX
            
                
          import React from 'react';
          import { TERipple } from 'tw-elements-react';
          
          export default function HoverEffectBasicExample(): JSX.Element {
            return (
              <div>
                <TERipple>
                  <div
                    className="relative max-w-xs overflow-hidden bg-cover bg-no-repeat">
                    <img
                      src="https://tecdn.b-cdn.net/img/new/fluid/city/113.webp"
                      className="max-w-xs"
                      alt="Louvre" />
                    <a>
                      <div
                        className="absolute bottom-0 left-0 right-0 top-0 h-full w-full overflow-hidden bg-[hsl(0,0%,98.4%,0.2)] bg-fixed opacity-0 transition duration-300 ease-in-out hover:opacity-100"></div>
                    </a>
                  </div>
                </TERipple>
              </div>
            );
          }
          
          
            
        

    Showing the animation effect

    As you can see in the above example, you can add any animation to any element on the page by using the following classes:

    • transition: used to animate the chaged properties on hover,
    • duration-x: used to define the duration of the animation where x is the time in milliseconds; e.g. duration-300.

    Then, you should be able to add any type of animation by changing the property on hover by using the class: [hover:tw-class-name] e.g. hover:opacity-100.

    Hey there 👋 we're excited about TW Elements for React and want to see it grow! If you enjoy it, help the project grow by sharing it with your peers. Every share counts, thank you!

    Color

    Change the color and opacity by manipulating color and .hover:opacity-* classes. Have a look at our masks docs to learn more.

    Louvre
    Louvre
    Louvre