Image component: support attachment-id

Frontity Roadmap :biking_man:

Feature Card


Right now users have to get the image information from the state, process that (in case of srcSet for example) and then pass it to the <Image> component. It’d be great if users could pass an id to the component and forget about the rest.

User Stories

As a theme developer
I want to pass an attachment id to the Image component
so that I don’t have to get and process the data myself

Possible solution

Add a new prop to the Image component, connect it to the state and retrieve the info it needs. It should also respect the other props it’s already receiving. For example, if it gets a src prop, it should use that value instead of the one from the state and so on.