Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support icons for navigation menus #419

Merged
merged 5 commits into from
Mar 3, 2023
Merged

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Feb 23, 2023

Supports an additional data attribute syntax to provide icons for navigation dropdown menus.

Previously, we supported icons only on page menu items, which are provided with the data-icon attribute. Multiple pages can be included in a single navigation menu by providing all collected pages with the same data-navmenu attribute value.

For example, these two pages are included in a nav menu title "Topics".

---
title: Issue 383
output:
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

# Pie Charts {data-icon="fa-chart-pie" data-navmenu="Topics"}

Pie Charts is accessed via a submenu entitled 'Topics'

# Info {data-icon="fa-info" data-navmenu="Topics"}

Info is also accessed via a submenu entitled 'Topics'

image

This change allows users to provide an icon for the navigation menu by providing the icon name in the data-navmenu-icon attribute. The first usage of navmenu must have this attribute for it to be added correctly.

---
title: Issue 383
output:
  flexdashboard::flex_dashboard:
    orientation: columns
    vertical_layout: fill
---

# Pie Charts {data-icon="fa-chart-pie" data-navmenu="Topics" data-navmenu-icon="fa-map-signs"}

Pie Charts is accessed via a submenu entitled 'Topics'

# Info {data-icon="fa-info" data-navmenu="Topics"}

Info is also accessed via a submenu entitled 'Topics'

image

Closes #383

vignettes/using.Rmd Outdated Show resolved Hide resolved
@gadenbuie gadenbuie requested a review from cpsievert March 2, 2023 21:35
@gadenbuie gadenbuie merged commit 7cfaf85 into main Mar 3, 2023
@gadenbuie gadenbuie deleted the feat/navigation-menu-icons branch March 3, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Icon in data-navmenu
2 participants