In order to design a v-btn-toggle with vertically aligned buttons, rather than horizontally

I'm currently in the process of developing a quiz using VueJS and Vuetify. My challenge lies in organizing the answer options vertically for the user to select. I attempted to utilize the v-btn-toggle component, but encountered an issue where the buttons are aligned horizontally by default. Is there a way to set them up vertically instead?

Here's how my layout looks:

<v-btn-toggle v-model="toggle_multiple" multiple>
    <v-btn>
         Answer 1
    </v-btn>
    <v-btn>
         Answer 2
    </v-btn>
    <v-btn>
         Answer 3
    </v-btn>
    <v-btn>
        Answer 4
    </v-btn>
</v-btn-toggle>

As suggested in this discussion, I tried styling it this way:

.v-btn-toggle{
    flex-direction: column;
}

The attempted solution resulted in an unexpected outcome, where only the first two answers were displayed partially as shown here: example image

Any assistance would be greatly appreciated.

Edit:

I've identified that the issue stems from Vuetify's preset CSS styles, particularly limiting the button height to 48 pixels with the following code:

.v-btn-group--density-default.v-btn-group {
  height: 48px;
}
This restriction is hindering me from creating button groups taller than 48 pixels. I am hesitant to alter Vuetify's defaults due to compatibility concerns. Instead, I am exploring ways to override the default CSS without success so far, as illustrated in this screenshot.

Answer №1

It was discovered by the original poster that Vuetify comes with a default height of 48 pixels.
After verifying that everything operated correctly in terms of flexbox, it was determined that the issue could be resolved by locally overriding the default values using CSS specificity.

The OP successfully targeted the specific button by using

#my-button-group {
  height: auto;
}

Alternatively, another option is to utilize

button.v-btn-group--density-default.v-btn-group
.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

The H1 tag fails to appear on the webpage

I can't figure out why my H1 is not visible. It seems to be hidden by a div. What's strange is that the parent div is visible when I change the background color to something other than transparent. Even an input tag within the same div displays c ...

What is the best way to delete HTML classes that were generated by a function?

Currently, I'm immersed in the Etch A Sketch project as part of my journey through The Odin Project. Using DOM manipulation, I successfully created a grid and displayed it on the screen. Now, my aim is to allow users to resize the grid by removing the ...

Hovering into Transition Time

My article card has a transition on the top attribute of the info div, which is supposed to be smooth and last for 0.3 seconds. However, the description suddenly appears during this transition. I'm trying to figure out why this is happening and how to ...

Tips for establishing communication between Vue components

Suppose I have a component defined as follows: Vue.component("hello", { name: "hello", data: ()=>{ return {color:"black"} }, template: "<div><div :style='{color:color}'>TEST</div><button @click='turnred& ...

Demonstrating various elements within an application using Vue3

I created two components and attempted to display them in a Vue 3 application. Here is my HTML code: <div id="app"> <image_preview> URL: [[image]] </image_preview> <file_uploader> Counter:[[coun ...

Vue.js - dynamically applying CSS classes based on conditions

Within a VueNative project that utilizes NativeBase as a component library, with tags prefixed by nb-, the code snippet below is found within the <template> tags of the footer.vue file which houses navigation buttons. This piece of logic successfully ...

Changing color based on AngularJS condition using CSS

My HTML code looks like this: <div> <i class="glyphicon glyphicon-envelope" style="margin-top: -50px; cursor:pointer; color: #1F45FC" ng-click="createComment(set_id)"> </i> Route <center> ...

Creating a hover effect for a div in jQuery or CSS: Keeping the div visible even when hovered

I have two divs in my layout: one is titled "title" and the other is called "description". I successfully made the description div appear when hovering over the title div. You can see an example of this behavior in action on this fiddle Now, I want to cha ...

Is there a way to fetch and display property changes in Vue Material's md-dialog?

In the component hierarchy, there is a parent component containing a child, which further contains an md-dialog component. The dialog is opened from the parent component using the following code: ParentComponent.vue <template> <div> < ...

Show a compact graphic in the upper-right-hand corner

Hey, I have this interesting idea but CSS isn't my strong suit. Any thoughts on how to achieve it? I'm looking to create a new class that, when applied to an item (like a div), displays a small clickable pre-defined image in the Top-Right corne ...

Personalize the file button for uploading images

I have a button to upload image files and I want to customize it to allow for uploading more than one image file. What is the logic to achieve this? <input type="file" />, which renders a choose button with text that says `no files chosen` in the sa ...

Adaptable data table featuring varying sizes of columns and rows

I'm attempting to design a grid that resembles the following: The challenge I'm facing is how to ensure that the column and row names adjust properly with the grid in the center. Currently, this is the code I have: jsfiddle example t t t t e ...

Unable to drag items into empty Vuetify v-data-table using SortableJS functionality

I'm looking to implement a drag-and-drop functionality between two v-data-tables in Vuetify using SortableJS. Check out this example with 3 tables: https://codepen.io/arno-van-oordt/pen/MdqrgK Everything works smoothly if both tables have at least on ...

Looking for an API to retrieve random quotes and images from a website?

Greetings, my name is Antika. I recently embarked on a coding journey and have been focusing on learning HTML/CSS along with the basics of JS. Level of Expertise: Beginner During my exploration, I stumbled upon this intriguing website - . It stands out a ...

Tips for securely authenticating between domains within an iframe without relying on third-party cookies

This project utilizes a PHP/Vue.js setup to enable clients to seamlessly integrate our service within an iframe window. Due to the tightening restrictions on third-party cookies, ensuring user security, particularly in Safari, has become more challenging. ...

CSS error with contrasting colors, the reason behind it is unknown

Here is the code snippet I am working on: I have set the background color to #f1f5ff and the font color to #181818. Despite thinking that the contrast is good, I am still encountering an error where the text is not visible. I have tried changing 'c ...

Elements floating in space, stretching across the entire width

In my design, I have a fixed size layout with a centered content container. My goal is to have the menu (home, about, contact, login) span 100% of the screen width. You can view the current setup in this jsfiddle: http://jsfiddle.net/Hxhc5/1/ I am aimin ...

Disappearance of icon upon hovering in CSS

I am currently working with Angular JS (1.x) and I have a requirement to display tooltip text when hovering over an info icon. The tooltip text appears properly, but the issue is that the icon disappears when hovered over. It reappears once the hover is re ...

Tips for utilizing identical properties across numerous styled elements:

Utilizing the styled-components library, I have enhanced the header components from the Blueprintjs library. The current template for the H6 component appears as follows: export const DH6 = styled(H6)` color: ${(props) => (props.white ? "white&qu ...

Is it possible to use conditional logic on child elements in formkit?

I am a bit confused about how this process functions. Currently, I am utilizing schema to create an address auto complete configuration. My goal is to have the option to display or hide the fields for manual input. This is the current appearance of the ...