Offcanvas (offcanvas)

Build hidden sidebars into your project for navigation, shopping carts, and more with a few classes and our JavaScript plugin.

🔗 External documentation.

ID Label Description Schema
title Title Offcanvas title.
body Body The content of the offcanvas.
responsive Responsive Hide content in offcanvas below the selected breakpoint. Above that breakpoint, the contents within will behave as usual.
                        type: string
enum:
    - offcanvas-sm
    - offcanvas-md
    - offcanvas-lg
    - offcanvas-xl
    - offcanvas-xxl

                      
backdrop Backdrop When backdrop is set to static, the offcanvas will not close when clicking outside of it.
                        type: string
enum:
    - 'false'
    - static

                      
scroll Body scrolling By default, body scrolling is disabled.
                        type: boolean

                      
heading_level Heading level Heading level of the offcanvas.
                        type: integer
enum:
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6

                      
offcanvas_id ID ID used by external buttons to toggle the visibility. Must start with a letter. Randomly generated if empty.
                        type: string

                      
            id: offcanvas
label: Offcanvas
description: 'Build hidden sidebars into your project for navigation, shopping carts, and more with a few classes and our JavaScript plugin.'
group: Dialog
homepage: 'https://getbootstrap.com/docs/5.3/components/offcanvas/'
variants:
    start:
        id: start
        label: Start
    end:
        id: end
        label: End
    top:
        id: top
        label: Top
    bottom:
        id: bottom
        label: Bottom
slots:
    title:
        id: title
        label: Title
        description: 'Offcanvas title.'
    body:
        id: body
        label: Body
        description: 'The content of the offcanvas.'
props:
    responsive:
        id: responsive
        label: Responsive
        description: 'Hide content in offcanvas below the selected breakpoint. Above that breakpoint, the contents within will behave as usual.'
        schema:
            type: string
            enum:
                - offcanvas-sm
                - offcanvas-md
                - offcanvas-lg
                - offcanvas-xl
                - offcanvas-xxl
    backdrop:
        id: backdrop
        label: Backdrop
        description: 'When backdrop is set to static, the offcanvas will not close when clicking outside of it.'
        schema:
            type: string
            enum:
                - 'false'
                - static
    scroll:
        id: scroll
        label: 'Body scrolling'
        description: 'By default, body scrolling is disabled.'
        schema:
            type: boolean
    heading_level:
        id: heading_level
        label: 'Heading level'
        description: 'Heading level of the offcanvas.'
        schema:
            type: integer
            enum:
                - 1
                - 2
                - 3
                - 4
                - 5
                - 6
    offcanvas_id:
        id: offcanvas_id
        label: ID
        description: 'ID used by external buttons to toggle the visibility. Must start with a letter. Randomly generated if empty.'
        schema:
            type: string
examples:
    preview:
        id: preview
        label: Preview
        renderable:
            '@component': offcanvas
            title: Offcanvas
            body: 'Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.'
            heading_level: 5

          

Start ( start )

Offcanvas
Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.
<div aria-labelledby="label_offcanvas-1687550750" class="offcanvas-start offcanvas" id="offcanvas-1687550750" tabindex="-1"> <div class="offcanvas-header"> <h5 class="offcanvas-title" id="label_offcanvas-1687550750">Offcanvas</h5> <button aria-label="Close" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#offcanvas-1687550750" type="button"> </button> </div> <div class="offcanvas-body">Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.</div> </div>

End ( end )

Offcanvas
Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.
<div aria-labelledby="label_offcanvas-1138979039" class="offcanvas-end offcanvas" id="offcanvas-1138979039" tabindex="-1"> <div class="offcanvas-header"> <h5 class="offcanvas-title" id="label_offcanvas-1138979039">Offcanvas</h5> <button aria-label="Close" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#offcanvas-1138979039" type="button"> </button> </div> <div class="offcanvas-body">Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.</div> </div>

Top ( top )

Offcanvas
Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.
<div aria-labelledby="label_offcanvas--678045369" class="offcanvas-top offcanvas" id="offcanvas--678045369" tabindex="-1"> <div class="offcanvas-header"> <h5 class="offcanvas-title" id="label_offcanvas--678045369">Offcanvas</h5> <button aria-label="Close" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#offcanvas--678045369" type="button"> </button> </div> <div class="offcanvas-body">Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.</div> </div>

Bottom ( bottom )

Offcanvas
Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.
<div aria-labelledby="label_offcanvas--699225256" class="offcanvas-bottom offcanvas" id="offcanvas--699225256" tabindex="-1"> <div class="offcanvas-header"> <h5 class="offcanvas-title" id="label_offcanvas--699225256">Offcanvas</h5> <button aria-label="Close" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#offcanvas--699225256" type="button"> </button> </div> <div class="offcanvas-body">Content for the offcanvas goes here. You can place just about any Bootstrap component or custom elements here.</div> </div>