Answers for "next js image src url"

1

using next js image component

import Image from 'next/image';
export default function Home() {
   return (
       <div>
           <Image
               src='/assets/pexels-kendall-hoopes-6000x4000.jpg'
               alt='universe'
               width={1500}
               height={1000}
           />
       </div>
   )
}
Posted by: Guest on July-12-2021
0

image next src url

// next.config.js
module.exports = {
    images: {
        domains: ['images.unsplash.com'],
    },
}

// pages/your_page_file.js
<Image
    alt="The guitarist in the concert."
    src="https://images.unsplash.com/photo-1464375117522-1311d6a5b81f?ixlib=rb-1.2.1&ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&auto=format&fit=crop&w=2250&q=80"
    width={2250}
    height={1390}
    layout="responsive"
/>
Posted by: Guest on October-07-2021

Browse Popular Code Answers by Language