Changing the Size of a ReactBootstrap Button in a ReactJS Application

I've been having trouble extending the buynow button to match the length of the paper box(@material-ui) above. The buynow button is being used with react-bootstrap, and although I've checked the raectbootstrap site, I couldn't find any useful information on how to change the size of the button. Any suggestions would be greatly appreciated.

https://i.sstatic.net/Yie47.png

-Snippet of code below

 <div style={{ float: "right", paddingRight: "5rem" }}>
        <TableContainer
          className="basket-summary"
          component={Paper}
          style={{ float: "right", top: "0", display: "flex", flexDirection: "column", maxHeight: "9vw", maxWidth: "14vw" }}
        >
          <Table >
            <TableHead>
              <TableRow>
                <TableCell>Summary </TableCell>
              </TableRow>
            </TableHead>
            <TableBody>
              <tr>
                <td>SubTotal:{totalPrice}</td>
              </tr>

              <tr>
                <td></td>
              </tr>
            </TableBody>
          </Table>
        </TableContainer>
        <ButtonGroup aria-label="quantityofproduct">
          <Button className=" button-block" variant="primary" name="subtract" value="subtract" onClick={() => buyNow(basketItems)}>
            Buy Now
          </Button>
        </ButtonGroup>
      </div>

-CSS formatting

.basket-summary {
    min-height: 15rem;
    min-width: 10rem;
    padding-bottom: 1rem;
    margin-top: 10rem;
}

Answer №1

To ensure the button fills the entire parent width, simply add min-width: 100% to its CSS properties.

.button-block {
  min-width: 100%;
  width: 100%;
}

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

"Bringing in" ES6 for Node

I am interested in utilizing import from ES6 instead of require from common.js in Node. Surprisingly, I initially assumed that import would function automatically in Node. However, it appears that it does not. Is there a specific npm package that needs t ...

ng-switch not refreshing on its own

I've encountered a strange issue with ng-switch that I can't seem to solve. On the top of my page, I have: #content{"ng-switch" => "root.showAlert"} %div.alert.ng-cloak#alert{"ng-switch-when" => "true"} {{root.alert.message}} %di ...

Checking a condition before loading a state in Angular's UI routing

I am currently using angular's ui-router to implement nested routing based on a specific condition. I need to check this condition before loading a state. .state('main.home', { url: "/:cnt", abstract: true, templ ...

While using the Android Firefox browser, I noticed that the keyboard is causing my screen to shrink in size

As I work on creating a cross-platform HTML page, I have encountered an issue with text fields on Android smartphones. When I attempt to type in a text box, the keyboard pops up and causes my HTML page to shrink within the viewport. I'm curious to kn ...

Guide on how to turn off cache in AngularJS + NodeJS CRUD application

I'm encountering an issue with cache in Internet Explorer, but everything seems to be working fine in Chrome. Whenever I try to add an item in my application, the data doesn't refresh automatically and I have to press Ctrl+R to manually refresh. ...

Create dynamic underline or bottom border for justified text using TCPDF

I'm facing difficulties trying to apply this design to TCPDF, as shown in the attached image (taking into account TCPDF's limited html capabilities). There should be a dynamic underline based on field values. Fields with no text should have a de ...

Prevent Button Click in ASP.NET After Validating Regular Expression in Textbox

How can I ensure that the asp button is disabled only after the user submits the form with the correct regular expression? Below is the form code: <asp:TextBox ID="TextBox2" runat="server" placeholder="Email" class="form-control" type="email" Font-Siz ...

What is the best way to use jQuery to integrate the post and get methods?

I have a couple of different jQuery functions: one for getting data and another for posting data. First, I use the get method to retrieve data and then I post my data using the post method. Now, I am curious about how I can combine these two functions. ...

What is the process for configuring the Sequelize Postgres model type to inet in a database?

I have been utilizing the sequelize ORM to manage my postgress database. Within my postgress database, we have been using the inet data type to store IPv4 and IPv6 values. While creating models in sequelize, I encountered the issue of not finding the ine ...

What could be causing the form body to return null in a PUT request?

What could be causing the form data to not be stored in req.body? EJS/HTML <form onsubmit="EditJob()" class="editForm"> <div class="form-group-edit"> <label for="position">Position</label> <input type="pos ...

What is the best way to display images with dynamic dimensions using next/image in Next.js?

In my scenario, I need to add images to a blog post without setting fixed dimensions since each image may have unique proportions. For example, I could upload a square image of 400 x 400 or a rectangular image of 400 x 200. According to the Next.js docume ...

Using the HTMLTextAreaElement object in Vue.js

I'm utilizing the Laravel package "laracasts/utilities" to transmit Laravel variables to JavaScript files. Below is the code snippet from my controller: JavaScript::put([ 'description' => $room->description ]); He ...

Does 1 CSS point amount to the same as 75% of a CSS Pixel?

Can anyone help clarify the relationship between CSS pixels and CSS points in modern web design? I've come across information stating that one CSS point is equivalent to 3/4 of a pixel. Is this accurate? Also, is it true that we can disregard the old ...

"Unfortunately, the JavaScript external function failed to function properly, but miraculously the inline function

Struggling to create a fullscreen image modal on the web? I was able to get it working fine when embedding the script directly into my HTML file, but as soon as I moved it to an external JS file, things fell apart. I've double-checked all the variable ...

What potential side-effects could occur from cloning the entire state object in React?

Upon reviewing a React code base I'm currently working on, I've noticed a recurring pattern that concerns me regarding potential bugs. Here is an example of the code in question: const newState = Object.assign({}, {}, this.state); newState.x = ...

Is there a way to modify the color of an icon in an icon-only toggle button in my specific situation?

My issue is with implementing Material Design in my project. Specifically, I am facing a problem with a group of icon-only toggle buttons within the com.google.android.material.button.MaterialButtonToggleGroup. These buttons have the style @style/Widget.Ap ...

What causes sections that are the same to have varying heights?

My layout consists of 4 sections, each with an aside and main taking up half the screen. The first section's aside starts on the left, then moves to the right for the second, alternating each section. I have copied the HTML of the first section for th ...

Real-time page updates and on-the-fly event monitoring

As I tackle a specific logical challenge, I find myself struggling a bit. Here is the issue at hand: When sending a PUT request from within a controller using certain factory methods, my aim is to update the data without triggering a page refresh. For exa ...

Troubleshooting problem with static divs not scrolling properly within an iframe on iOS devices

I'm encountering an issue with iOS scrolling on my iPad. All other platforms I've tested work perfectly fine except for this one. While I have a love-hate relationship with iOS, I managed to make the entire iframe content scroll within the parent ...

Is there an h1 heading on this page?

Trying to enhance the accessibility of a website by properly setting up the headers. Running into issues with ensuring they are in the correct order. If there is code that could be applied across all pages to set h1 if it doesn't exist (promoting h2, ...