I found this code snippet in the official Bootstrap 5 demos, but I'm struggling to figure out how to transition the off-canvas menu from left-to-right. The documentation and demo codes are quite different.
As I work on a landing page in Bootstrap 5, my aim is to replace the default menu with an off-canvas menu featuring a close icon.
<!doctype html>
<html lang="fa" dir="rtl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap.rtl.min.css">
<title>Hello, world!</title>
</head>
... remaining HTML code as it is ...
The above HTML code showcases an example of implementing an off-canvas navbar utilizing Bootstrap's features. To shift the navbar from right to left, simply add .navmenu-fixed-left
to the .navbar-offcanvas
.