Navigation

The TopNav component is used to create a top navigation.

Basic Collapsible Navigation

Items inside the NavContentToggle will be availble inside the collapsible menu on smaller screens. Items inside NavContent will be visible on smaller screens as well.

Expand/Collapse source code
Copied
Copy source sections
Copy source as is
SSR/CSR
Can be used both on the server and on the client side.
Imports
import live-web.dom
import live-web-view.navigation
Styles
static any[] use = [TopNav]
Content
TopNav{ position: 'static'
    NavContent{
        NavBrand{ A{ href: `#` T`Brand` } }
        NavToggleButton{}
    }
    NavContentToggle{ 
        Ul{ 
            Li{ A{ href: `#` T`Home` } }
            Li{ A{ href: `#` T`Install` } }
            Li{ A{ href: `#` T`Documentation` } }
        }
    }
}

Wide Content

Items inside the NavContentWide will be invisible on smaller screens.

Expand/Collapse source code
Copied
Copy source sections
Copy source as is
SSR/CSR
Can be used both on the server and on the client side.
Imports
import live-web.dom
import live-web-view.navigation
Styles
static any[] use = [TopNav]
Content
TopNav{ position: 'static'
    NavContent{
        NavBrand{ A{ href: `#` T`Brand` } }
        NavToggleButton{}
    }
    NavContentWide{
        Ul{
            Li{ A{ href: '#' T`Wide Screen Link` }}
        }
    }
    NavContentToggle{ 
        Ul{ 
            Li{ A{ href: `#` T`Home` } }
            Li{ A{ href: `#` T`Documentation` } }
        }
    }
}