question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avatar images used inside buttons should have the same size as buttons

See original GitHub issue

Steps to reproduce

Use <v-avatar inside a <v-btn icon> to create an avatar button:

<v-btn icon>
  <v-avatar>
    <img src="https://randomuser.me/api/portraits/men/1.jpg">
  </v-avatar>
</v-btn>          

Versions

Vuetify 0.14

What is expected ?

The avatar’s image should be the same size as that of the buttons.

What is actually happening ?

The icon buttons are sized 36px by 36px, but the avatar image is sized 40px by 40px - so the avatar images appears too large when compared to other buttons (on the toolbar).

Reproduction Link

https://codepen.io/wernerm/pen/OjxpOK

Please Note that the codepen’s stylesheet contains styles to change the avatar image size.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
Heunsigcommented, Jan 3, 2019

I think you can use like this

<v-btn fab icon>
    <v-avatar
        size="45"
     >
         // image
     </v-avatar>
</v-btn>

fab and icon attributes in v-btn tag

0reactions
esynapscommented, Nov 8, 2019

You can also do this:

<v-btn icon width="auto" height="auto"  class="pa-1" style="border: 2px solid #a9dff1;">
        <v-avatar size="70">
         // image
        </v-avatar>
        </v-btn>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Styling and sizing images as buttons - Google Groups
My main use is as buttons or icons. I would like to list place both svg and other images in the icon field...
Read more >
Issue getting button to be the same size as an image
The issue is, my button ALWAYS has the same gap between the sides of the image and the sides of the button, changing...
Read more >
How do I edit these buttons to appear the same width, size ...
Currently these buttons and images are displayed using Hero Banners, and I am looking to make the buttons the same size, width, and...
Read more >
Fixed width for buttons or proportional with the text?
In my opinion, if the buttons are one over the other then try to adapt the shorter to have the wider's width. In...
Read more >
Functional Images | Web Accessibility Initiative (WAI) - W3C
They are used in buttons, links, and other interactive elements. ... It has the text alternative “W3C home” to indicate where the link...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found