Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing down className prop in S3Image component #1272

Closed
Hugodby opened this issue Jul 19, 2018 · 6 comments · Fixed by #4212
Closed

Passing down className prop in S3Image component #1272

Hugodby opened this issue Jul 19, 2018 · 6 comments · Fixed by #4212
Assignees
Labels
feature-request Request a new feature React React related issues Storage Related to Storage components/category

Comments

@Hugodby
Copy link

Hugodby commented Jul 19, 2018

Feature request

What is the current behavior?
In aws-amplify-react Passing className prop to S3Image components has no effect. The prop is ignored. I want to be able to set CSS class on the S3Image component.

<S3Image className="thumbnail" imgKey={props.image} />
@powerful23 powerful23 added Storage Related to Storage components/category feature-request Request a new feature labels Jul 19, 2018
@jnreynoso
Copy link

it is not possible to modify the sizes (width, height) of the image contained in the div.

@gabehollombe-aws
Copy link

👍 I'd like this, too.

My specific use case is that I'm using semantic-ui-react and am rendering some images captured by a webcam, with the img src passed directly to Semantic UI React's Image component. I'm rendering these images alongside existing images in an S3 bucket via aws-amplify-react's S3Image component.

My problem is that I want the S3Image images to render similarly to the Image images. To do this, I'd like to get the img tag inside the S3Image component to have 'ui image' classes on it. It would be nice if I could pass those in via a prop to S3Image.

@jordanranz
Copy link
Contributor

FYI, we have started an RFC discussion for a proposed Amplify UI Component refactor to increase customizability and flexibility for our components. Please feel free to add any additional comments to the following issue:

#3279

@akasper-connyun
Copy link

Would love to have this too! The workaround with an enclosing div and img in CSS is not nice as one cannot reuse CSS classes.

@emmafass
Copy link

@ericclemmons I am trying to pass className to S3Image and I am not able to get it to recognize the className prop.

<S3Image imgKey={profilePictureKey} className="img-thumbnail" />

Does this look right to you?

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request a new feature React React related issues Storage Related to Storage components/category
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants