You can trigger the Modal by set the "display" value instead of pass it to className directly. Bascially, replace

 <div className={`modal ${modalTriggered ? "hide" : "show"}`}>

by

<div style={{ display: modalTriggered ? 'block' : 'none' }}>

will fix your issue

Answer from Yen Nguyen on Stack Overflow
๐ŸŒ
React Bootstrap
react-bootstrap.netlify.app โ€บ modals
Modals | React Bootstrap
You can focus on an element inside the modal using autoFocus attribute on the element. ... You can specify a Bootstrap large or small modal by using the size prop.
๐ŸŒ
Bootstrap
getbootstrap.com โ€บ docs โ€บ 5.0 โ€บ components โ€บ modal
Modal ยท Bootstrap v5.0
Use Bootstrapโ€™s JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Discussions

React-bootstrap Modal not opening on top of page
It looks like you didn't install bootstrap via npm in your codesandbox - try doing that and seeing if that adds the necessary css and js behavior. More on reddit.com
๐ŸŒ r/nextjs
3
1
September 16, 2022
Triggering a Bootstrap Modal in React without npm react-bootstrap
I try to code a Modal in React.js using Bootstrap5 but I can not use npm react-bootstrap out of several reasons. I tryd an approach where I use state to set Modal classes with a button which worked... More on stackoverflow.com
๐ŸŒ stackoverflow.com
React Bootstrap modal
I am trying to get a modal to show which will serve as the edit recipe, and another one for my add recipe. I read the your component should only do one thing, and my RecipeBox is showing the recipes when clicked on. So it made sense to me to make the modal another component, but I cant get ... More on forum.freecodecamp.org
๐ŸŒ forum.freecodecamp.org
1
0
June 1, 2018
size - Specify/Set width and height on a react-boostrap modal - Stack Overflow
How can I apply a dynamic width and height to a react-bootstrap modal window? I have checked the react-bootstrap docs here but could not figure out how to do that. Actually the value of width and h... More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
Medium
medium.com โ€บ nerd-for-tech โ€บ how-to-get-a-react-bootstrap-modal-to-open-and-close-using-a-button-of-your-choice-in-a-p-cde3ef6c0d4c
How to get a React Bootstrap Modal to open and close using a button of your choice in a parent component | by Sharad Satsangi | Nerd For Tech | Medium
May 5, 2021 - Now, when a user clicks the Tab marked Show the Modal!, theyโ€™ll open up the Modal, and when they click the x or close buttons on the component the Modal will close. Easy-peasy. React-Bootstrap is one of many custom frameworks freely available to power-up our frontend development needs.
๐ŸŒ
Bootstrap
getbootstrap.com โ€บ docs โ€บ 5.3 โ€บ components โ€บ modal
Modal ยท Bootstrap v5.3
Use Bootstrapโ€™s JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
๐ŸŒ
npm
npmjs.com โ€บ package โ€บ react-bootstrap-modal
react-bootstrap-modal - npm
September 24, 2018 - Partly a port of jschr's bootstrap modal. Reimplements the Twitter Bootstrap Modal component in a React friendly way.
      ยป npm install react-bootstrap-modal
    
Published ย  Sep 24, 2018
Version ย  4.2.0
Author ย  Jason Quense
๐ŸŒ
MDBootstrap
mdbootstrap.com โ€บ standard โ€บ modal
React Modal with Bootstrap - free examples & tutorial
Due to how HTML5 defines its semantics, the autofocus HTML attribute has no effect in Bootstrap modals. To achieve the same effect, use some custom JavaScript: ... import React, { useEffect, useRef, useState } from 'react'; import { MDBBtn, MDBModal, MDBModalDialog, MDBModalContent, MDBModalHeader, MDBModalTitle, MDBModalBody, MDBModalFooter, MDBInput, } from 'mdb-react-ui-kit'; export default function App() { const [open, setOpen] = useState(false); const inputRef = useRef(null); useEffect(() => { if (open) { inputRef.current?.focus(); } }, [open]); return ( <> <MDBBtn onClick={() => setOpen(
Find elsewhere
๐ŸŒ
Reddit
reddit.com โ€บ r/nextjs โ€บ react-bootstrap modal not opening on top of page
r/nextjs on Reddit: React-bootstrap Modal not opening on top of page
September 16, 2022 -

In my nextjs project, I have been trying to implement a Bootstrap Modal as a component similar to this vertically centered code example.

The project structure:

components   
- modal.js 
pages  
- index.js  
- about.js 

From index.js I call the modal component:

<Button variant="primary" onClick={() => setModalShow(true)}>         
Launch vertically centered modal  
</Button>  

<ModalMailingList show={modalShow} onHide={() => setModalShow(false)} /> 

This results in the modal NOT opening in a window on top of my page, but rather toggle the modal as a div inside the page.

Here is the working code, of the unwanted behavior.

How can I implement the modal component and make it open ON TOP of the page? (as in the original react-bootstrap code example)

๐ŸŒ
Pluralsight
pluralsight.com โ€บ blog โ€บ guides
Working with Bootstrap's Modals in React | Online Courses, Learning Paths, and Certifications - Pluralsight
November 26, 2019 - import Modal from "react-bootstrap/Modal"; import "bootstrap/dist/css/bootstrap.min.css"; const App = () => { return ( <Modal show={true}> <Modal.Header>Hi</Modal.Header> <Modal.Body>asdfasdf</Modal.Body> <Modal.Footer>This is the footer</Modal.Footer> </Modal> ); };
๐ŸŒ
React Bootstrap
react-bootstrap.netlify.app
React Bootstrap | React Bootstrap
React-Bootstrap replaces the Bootstrap JavaScript.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ reactjs โ€บ react-bootstrap-modal-component
React-Bootstrap Modal Component - GeeksforGeeks
March 7, 2024 - React-Bootstrap is a front-end framework that was designed keeping react in mind. Modal Component provides a way to add dialogs to our website for user notifications, displaying information, or to display completely custom information to the user.
๐ŸŒ
Trimble
modus-react-bootstrap.trimble.com โ€บ components โ€บ modals
Modals | Trimble Modus React Bootstrap Developer Guide
You can specify a bootstrap large or small modal by using the "size" prop.These sizes kick in at certain breakpoints to avoid horizontal scrollbars on narrower viewports. import Modal from `@trimbleinc/modus-react-bootstrap/Modal`
๐ŸŒ
W3Schools
w3schools.com โ€บ bootstrap โ€บ bootstrap_modal.asp
Bootstrap Modals
For a complete reference of all modal options, methods and events, go to our Bootstrap JS Modal Reference.
๐ŸŒ
Pluralsight
pluralsight.com โ€บ blog โ€บ guides
How to Trigger Modal for React Bootstrap | Online Courses, Learning Paths, and Certifications - Pluralsight
September 15, 2020 - React Bootstrap is a pure React implementation of the popular Bootstrap CSS framework. The react-bootstrap library does not use jQuery under the hood, as manipulating DOM directly is considered an anti-pattern in the React ecosystem.
๐ŸŒ
Stack Overflow
stackoverflow.com โ€บ questions โ€บ 72866933 โ€บ show-bootstrap-5-modal-in-react-on-conditional-situation
Show Bootstrap 5 Modal in react on conditional situation
It was my bad. Here, a new code. Please forget about bootstrap first. You can style or edit Modal component as you want. Add any props you want. But basic is one boolean value and one close function and position styling for full screen. This is how you make your own modal.
๐ŸŒ
MUI
mui.com โ€บ material-ui โ€บ react-modal
React Modal component - Material UI
The modal component provides a solid foundation for creating dialogs, popovers, lightboxes, or whatever else.
๐ŸŒ
React-bootstrap
react-bootstrap.github.io โ€บ react-overlays โ€บ api โ€บ Modal
Modal
A callback fired when the Modal is opening. ... A function that returns a backdrop component. Useful for custom backdrop rendering. renderBackdrop={props => <MyBackdrop {...props} />} type:(props: RenderModalBackdropProps) => ReactReactNode
๐ŸŒ
W3Schools
w3schools.com โ€บ bootstrap5 โ€บ bootstrap_modal.php
Bootstrap 5 Modal
<!-- Button to Open the Modal --> <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#myModal"> Open modal </button> <!-- The Modal --> <div class="modal" id="myModal"> <div class="modal-dialog"> <div class="modal-content"> <!-- Modal Header --> <div class="modal-header"> <h4 class="modal-title">Modal Heading</h4> <button type="button" class="btn-close" data-bs-dismiss="modal"></button> </div> <!-- Modal body --> <div class="modal-body"> Modal body..