echo Nav::widget([ 'items' => [ ['label' => 'Home', 'url' => ['/site/index']], ['label' => 'About', 'url' => ['/site/about']], ['label' => 'Contact', 'url' => ['/site/contact']], ], ]);
echo Nav::widget([ 'items' => [ ['label' => 'Dropdown Menu', 'items' => [ ['label' => 'Dropdown Item 1', 'url' => '#'], ['label' => 'Dropdown Item 2', 'url' => '#'], ['label' => 'Dropdown Item 3', 'url' => '#'], ]], ['label' => 'Tabs', 'items' => [ ['label' => 'Tab 1', 'url' => '#'], ['label' => 'Tab 2', 'url' => '#'], ['label' => 'Tab 3', 'url' => '#'], ], 'options' => ['class' => 'nav-tabs']], ['label' => 'Pills', 'items' => [ ['label' => 'Pill 1', 'url' => '#'], ['label' => 'Pill 2', 'url' => '#'], ['label' => 'Pill 3', 'url' => '#'], ], 'options' => ['class' => 'nav-pills']], ], ]);This example creates a navigation menu with a dropdown menu, tabs, and pills. The dropdown menu contains three items, and the tabs and pills contain three items each. Package Library: yii2-bootstrap4-nav.