Skip to content

Theme-UI and Next.js 11 both have Image Components #1869

Answered by lachlanjc
weisisheng asked this question in General
Discussion options

You must be logged in to vote

Great question! This is a really frustrating one since Next's Image component doesn't play nice with literally any styling solution I've found. For image styles, using Next's built-in objectFit & objectPosition props is definitely the way to go. For wrapping styles, what I typically do is wrap the Next Image with a Theme UI Box, sometimes using a child selector inside sx on the Box works too (img: { borderRadius: 'card' } etc).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lachlanjc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants