Navbar (navbar)

Powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.

🔗 External documentation.

ID Label Description Schema
brand Brand
navigation Navigation Navigation elements (brand, text, etc.) displayed even on small screens.
navigation_collapsible Navigation collapsible Navigation elements (menu links, etc.) displayed on collapsible dropdown on small screens.
offcanvas_label Offcanvas label When using the offcanvas feature, used for labelling.
navbar_id ID Must start with a letter. Randomly generated if empty.
                        type: string

                      
placement Placement
                        type: string
enum:
    - default
    - fixed-top
    - fixed-bottom
    - sticky-top
    - sticky-bottom

                      
toggler_position Toggler position Navbar togglers are left-aligned by default, but should they follow a sibling element like a .navbar-brand, they’ll automatically be aligned to the far right. Reversing your markup will reverse the placement of the toggler
                        type: string
enum:
    - start
    - end

                      
toggle_action Toggle action Transform your expanding and collapsing navbar into an offcanvas drawer with the offcanvas plugin.
                        type: string
enum:
    - collapse
    - offcanvas

                      
offcanvas_position Offcanvas position
                        type: string
enum:
    - start
    - end

                      
            id: navbar
label: Navbar
description: 'Powerful, responsive navigation header, the navbar. Includes support for branding, navigation, and more, including support for our collapse plugin.'
group: Navbar
homepage: 'https://getbootstrap.com/docs/5.3/components/navbar/'
variants:
    default:
        id: default
        label: Default
    expand_sm:
        id: expand_sm
        label: 'Expand small'
    expand_md:
        id: expand_md
        label: 'Expand medium'
    expand_lg:
        id: expand_lg
        label: 'Expand large'
    expand_xl:
        id: expand_xl
        label: 'Expand extra large'
    expand_xxl:
        id: expand_xxl
        label: 'Expand extra extra large'
    dark:
        id: dark
        label: 'Dark (deprecated)'
    dark__expand_sm:
        id: dark__expand_sm
        label: 'Dark expand small (deprecated)'
    dark__expand_md:
        id: dark__expand_md
        label: 'Dark expand medium (deprecated)'
    dark__expand_lg:
        id: dark__expand_lg
        label: 'Dark expand large (deprecated)'
    dark__expand_xl:
        id: dark__expand_xl
        label: 'Dark expand extra large (deprecated)'
    dark__expand_xxl:
        id: dark__expand_xxl
        label: 'Dark expand extra extra large (deprecated)'
slots:
    brand:
        id: brand
        label: Brand
    navigation:
        id: navigation
        label: Navigation
        description: 'Navigation elements (brand, text, etc.) displayed even on small screens.'
    navigation_collapsible:
        id: navigation_collapsible
        label: 'Navigation collapsible'
        description: 'Navigation elements (menu links, etc.) displayed on collapsible dropdown on small screens.'
    offcanvas_label:
        id: offcanvas_label
        label: 'Offcanvas label'
        description: 'When using the offcanvas feature, used for labelling.'
props:
    navbar_id:
        id: navbar_id
        label: ID
        description: 'Must start with a letter. Randomly generated if empty.'
        schema:
            type: string
    placement:
        id: placement
        label: Placement
        schema:
            type: string
            enum:
                - default
                - fixed-top
                - fixed-bottom
                - sticky-top
                - sticky-bottom
    toggler_position:
        id: toggler_position
        label: 'Toggler position'
        description: 'Navbar togglers are left-aligned by default, but should they follow a sibling element like a .navbar-brand, they’ll automatically be aligned to the far right. Reversing your markup will reverse the placement of the toggler'
        schema:
            type: string
            enum:
                - start
                - end
    toggle_action:
        id: toggle_action
        label: 'Toggle action'
        description: 'Transform your expanding and collapsing navbar into an offcanvas drawer with the offcanvas plugin.'
        schema:
            type: string
            enum:
                - collapse
                - offcanvas
    offcanvas_position:
        id: offcanvas_position
        label: 'Offcanvas position'
        schema:
            type: string
            enum:
                - start
                - end
examples:
    preview:
        id: preview
        label: Preview
        renderable:
            '@component': navbar
            brand:
                -
                    '@element': img
                    width: 40px
                    height: 32px
                    src: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1MTIiIGhlaWdodD0iNDA4Ij48ZGVmcz48bGluZWFyR3JhZGllbnQgaWQ9ImJzLWxvZ28tYSIgeDE9Ijc2LjA3OSIgeDI9IjUyMy40OCIgeTE9IjEwLjc5OCIgeTI9IjM2NS45NDUiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj48c3RvcCBzdG9wLWNvbG9yPSIjOTAxM2ZlIi8+PHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSI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NTQuNjkyLTE4OS40OGg0NS45MTFjMjQuOTU4IDAgMzkuMTMxIDExLjEyOCAzOS4xMzEgMzEuMjc5IDAgMjEuNTA1LTE2LjQ4NCAzMy41MzUtNDYuMzcyIDMzLjUzNWgtMzguNjd2LTY0LjgxNHptMCAxNjEuOTYxdi03MS40MzFoNDUuNjAyYzMyLjY2MSAwIDQ5LjYwOCAxMi4wMyA0OS42MDggMzUuNDkgMCAyMy40NTktMTYuNDg0IDM1Ljk0MS00Ny42MDUgMzUuOTQxaC00Ny42MDV6Ii8+PC9zdmc+Cg=='
                -
                    '@element': a
                    '@content': Brand
                    href: '#'
            navigation:
                '@element': span
                '@content': Text
                class:
                    - navbar-text
            navigation_collapsible:
                '@component': navbar_nav
                '@variant': default
                items:
                    -
                        title: Home
                        url: 'https://example.com'
                    -
                        title: Library
                        url: 'https://example.com'
                        below:
                            0:
                                title: 'Dropdown header'
                                link_attributes:
                                    class: [dropdown-header]
                            1:
                                title: 'Sub 1'
                                url: 'https://example.com'
                            3:
                                title: 'Sub 2 after divider'
                                url: 'https://example.com'
                            4:
                                title: 'Dropdown text'
                    -
                        title: Data
            offcanvas_label: Offcanvas
            placement: default
            toggler_position: end
            toggle_action: collapse
            offcanvas_position: end

          

Default ( default )

Expand small ( expand_sm )

Expand medium ( expand_md )

Expand large ( expand_lg )

Expand extra large ( expand_xl )

Expand extra extra large ( expand_xxl )

Dark (deprecated) ( dark )

Dark expand small (deprecated) ( dark__expand_sm )

Dark expand medium (deprecated) ( dark__expand_md )

Dark expand large (deprecated) ( dark__expand_lg )

Dark expand extra large (deprecated) ( dark__expand_xl )

Dark expand extra extra large (deprecated) ( dark__expand_xxl )