Giter Club home page Giter Club logo

Comments (4)

MajesticPotatoe avatar MajesticPotatoe commented on July 21, 2024

This is working as intended. icon prop is dual purpose: it performs styling (icon button) and allows for an icon to be passed through, but it is entirely intended to be used with an icon. when you provide content to the the default slot, this overwrites all of the slot content (which includes the default generated icon), using the text prop wouldn't render when icon is being used, as the intended purpose of icon is to display an icon. The equivalent text styling in this manner would be rounded="xl" with text prop

I will say however that there could probably be some pointers updated about this in the docs for clarification (and usage example should probably be fixed to hide default slot output when using the icon prop)

from vuetify.

06b avatar 06b commented on July 21, 2024

The explanation makes sense and as I created this issue, I figured it was most likely functioning as designed & there was a bug with the documentation.

In respect of

using the text prop wouldn't render when icon is being used, as the intended purpose of icon is to display an icon. The equivalent text styling in this manner would be rounded="xl" with text prop

What I was suggesting is that when using the text prop with the icon it could act as the text alternative for the icon, since the purpose of the icon is to display the icon, then the text prop purpose would be to ensure that the button's purpose is clear to all users.

For example:
<v-btn icon="mdi-refresh" text="Refresh"></v-btn>
could output the following
<v-btn aria-label="Refresh" icon="mdi-refresh"></v-btn>

from vuetify.

MajesticPotatoe avatar MajesticPotatoe commented on July 21, 2024

That sounds more like a feature request to have text prop apply aria-label (though doing <v-btn aria-label="Refresh" icon="mdi-refresh" /> works already by itself, and seems to already been discussed to a degree in #11937).

All in all icon isn't intended to work with the text prop outside of maybe using it as a textual avatar button substitute (eg <v-btn icon text="A" />). It applies a strict circular icon button style (akin to v2's fab), and if an icon is provided, displays the icon.

from vuetify.

06b avatar 06b commented on July 21, 2024

Agreed, that would be a feature request. On that note, considering the details you've provided, I completely agree with you and I would view this issue as resolved with if the usage example were to hide the default slot output when using the icon prop.

from vuetify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.