<!doctype html>
<
html
lang
=
"en"
>
<
head
>
<
link
href
=
rel
=
"stylesheet"
integrity
=
"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC"
crossorigin
=
"anonymous"
>
<
script
src
=
integrity
=
"sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin
=
"anonymous"
>
</
script
>
</
head
>
<
body
class
=
"container"
>
<
h1
class
=
"text-success"
>
GeeksforGeeks
</
h1
>
<
strong
>
Bootstrap 5 Offcanvas Usage Via data attributes
</
strong
>
<
div
class
=
"container"
>
<
button
class
=
"btn btn-success"
type
=
"button"
data-bs-toggle
=
"offcanvas"
data-bs-target
=
"#offcanvasLeft"
>
This button has those Data Attributes to use<
br
>
an Offcanvas Which is the default placed offcanvas
</
button
>
</
div
>
<
div
class
=
"offcanvas offcanvas-start"
id
=
"offcanvasLeft"
>
<
div
class
=
"offcanvas-header"
>
<
h5
class
=
"offcanvas-title"
>
This is the Default offcanvas
Triggered with the data attributes.
</
h5
>
<
button
type
=
"button"
class
=
"btn-close text-reset"
data-bs-dismiss
=
"offcanvas"
aria-label
=
"Close"
>
</
button
>
</
div
>
<
div
class
=
"offcanvas-body"
>
<
p
>
This Offcanvas has the default
placement which is left.</
p
>
<
br
>
<
ul
class
=
"list-group"
>
<
li
class
=
"list-group-item"
>An item</
li
>
<
li
class
=
"list-group-item"
>A second item</
li
>
<
li
class
=
"list-group-item"
>A third item</
li
>
<
li
class
=
"list-group-item"
>A fourth item</
li
>
<
li
class
=
"list-group-item"
>And a fifth one</
li
>
</
ul
>
</
div
>
</
div
>
</
body
>
</
html
>