Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Material UI have an Image component?

I used other react components before, they mostly have their own Image component, but I can't find that in Material-UI?

Or is it done via CardMediaAPI? or simply use tags? Thanks!

like image 639
pure Avatar asked Apr 17 '20 03:04

pure


People also ask

How do I add an image to my material UI toolbar?

Just add a closing tag to your Appbar element (remove the self closing tag) and put the image inside.

Does material UI have Carousel?

A Generic, extendible Carousel UI component for React using Material UI. It switches between given children using a smooth animation.

What is the difference between material UI and material UI core?

Material UI: the set of foundational MIT React components is now called MUI Core. Material UI: the Material Design components developed by MUI. Also, we ditched the hyphen! Material UI X: the set of advanced React components is now called MUI X.

Is material UI a component library?

Developed by Google in 2014, Material-UI is a general-purpose customizable component library to build React applications. The folks at Google designed Material-UI as an adaptable system of guidelines, components, and tools to make app building beautiful yet straightforward.


1 Answers

Another option (at least in v5) is to use the Box component and select the underlying html element to be img as given in the example below (copied from official docs for v5)

     <Box
        component="img"
        sx={{
          height: 233,
          width: 350,
          maxHeight: { xs: 233, md: 167 },
          maxWidth: { xs: 350, md: 250 },
        }}
        alt="The house from the offer."
        src="https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&w=350&dpr=2"
      />
like image 122
Peter Gerdes Avatar answered Oct 11 '22 22:10

Peter Gerdes