Visibility
React Bootstrap 5 Visibility component
Control the visibility, without modifying the display, of elements with visibility utilities.
Basic example
Set the visibility
of elements with our visibility utilities. These utility
classes do not modify the display
value at all and do not affect layout –
.invisible
elements still take up space in the page. Content will be hidden both
visually and for assistive technology/screen reader users.
Apply .visible
or .invisible
as needed.
import React from 'react';
export default function App() {
return (
<>
<div className="visible">...</div>
<div className="invisible">...</div>
</>
);
}
/* Class */
.visible {
visibility: visible !important;
}
.invisible {
visibility: hidden !important;
}