Chapter 212: <Img>
Core Idea
The <Img> tag can be used like a regular <img> HTML tag.
Key Concepts
- API
- src
- effects?<AvailableFrom v="4.0.469" />
- cropLeft?<AvailableFrom v="4.0.500" />
- cropRight?<AvailableFrom v="4.0.500" />
- cropTop?<AvailableFrom v="4.0.500" />
- cropBottom?<AvailableFrom v="4.0.500" />
- onError
Code Examples
export const MyComp: React.FC = () => {
return (
<AbsoluteFill>
<Img src={staticFile('hi.png')} />
</AbsoluteFill>
);
};
- What it demonstrates: Usage pattern for
<Img> from the official docs.
Key Takeaways
- Understand api when working with
<Img>.
- Understand src when working with
<Img>.
- Understand effects?<availablefrom v="4.0.469" /> when working with
<Img>.
- Understand cropleft?<availablefrom v="4.0.500" /> when working with
<Img>.
- Understand cropright?<availablefrom v="4.0.500" /> when working with
<Img>.
Connects To
- Animatedimage: related page in the Assets & Media section.
- Delaying: related page in the Assets & Media section.
- Exporting: related page in the Assets & Media section.