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

    Images

    Tailwind CSS React Images

    Responsive images built with Tailwind CSS. Use classes for images to make your pictures responsive and more beautiful. Download for free without registration.


    Responsive images

    Use .max-w-full and .h-auto classes to make a image responsive.

    ...
    • JSX
            
                
          import React from 'react';
    
          export default function App() {
            return (
              <img
              src="https://tecdn.b-cdn.net/img/new/slides/041.jpg"
              className="h-auto max-w-full"
              alt="..." />
            );
          }
          
            
        

    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!

    Thumbnails

    Use .border class to give an image a rounded 1px border appearance.

    ...
    • JSX
            
                
          import React from 'react';
    
          export default function App() {
            return (
                <img
                src="https://tecdn.b-cdn.net/img/new/standard/city/041.jpg"
                className="max-w-sm rounded border bg-white p-1 dark:border-neutral-700 dark:bg-neutral-800"
                alt="..." />
            );
          }
          
            
        

    Shadows

    Use shadow classes to add a shadow to the image.

    • JSX
            
                
          import React from 'react';
    
          export default function App() {
            return (
                <img
                src="https://tecdn.b-cdn.net/img/new/standard/city/042.jpg"
                className="h-auto max-w-sm shadow-lg dark:shadow-black/30"
                alt="" />
            );
          }
          
            
        

    Shadow on hover

    Use .transition-shadow class to the element to apply a shadow hover effect.

    • JSX
            
                
          import React from 'react';
    
          export default function App() {
            return (
                <img
                src="https://tecdn.b-cdn.net/img/new/standard/city/041.webp"
                className="h-auto max-w-sm rounded-lg shadow-none transition-shadow duration-300 ease-in-out hover:shadow-lg hover:shadow-black/30"
                alt="" />   
            );
          }
          
            
        

    Shapes

    Change the shape of the image.

    • JSX
            
                
          import React from 'react';
    
          export default function App() {
            return (
              <div className="mb-4">
                <img
                    src="https://tecdn.b-cdn.net/img/new/standard/city/047.jpg"
                    className="h-auto max-w-full rounded-lg"
                    alt="" />
            </div>
            <div className="mb-4">
                <img
                    src="https://mdbootstrap.com//img/Photos/Square/1.jpg"
                    className="h-auto max-w-full rounded-full"
                    alt="" />
            </div>
            <div className="mb-4">
                <img
                    src="https://tecdn.b-cdn.net/img/new/standard/city/044.jpg"
                    className="h-auto max-w-full rounded-full"
                    alt="" />
            </div>
            );
          }
          
            
        

    Related resources

    Bootstrap Gallery Bootstrap Carousel Slider with Thumbnails How To Center Image How to make image responsive in Bootstrap Hover effect Gallery

    If you are looking for more advanced options, try Bootstrap Images from MDBootstrap.

    • Responsive images
    • Thumbnails
    • Shadows
    • Shadow on hover
    • Shapes
    • Related resources
    Get useful tips & free resources directly to your inbox along with exclusive subscriber-only content.
    Join our mailing list now
    © 2023 Copyright: MDBootstrap.com