@gemeente-denhaag/sidenav

中文文档
2.0.0发布于 2025/02/25EUPL-1.2TypeScriptESM + CJS近 30 天下载 7953

A sidenav component

此软件包已被标记为弃用

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

原始使用文档
文档目录18 节
  1. When to use
  2. Minimum interaction cost
  3. Typical-path support
  4. Discoverability
  5. Alternatives and related components
  6. Anatomy
  7. (Interactive) states
  8. Design properties
  9. Typography
  10. Colors
  11. Interactive states
  12. Structure
  13. Accessibility
  14. Content guidelines
  15. Best practices
  16. Dos
  17. Don’ts
  18. References

Sidenav

The subnavigation is used as navigational element. This appears as an overlay on mobile and in the sidebar on a desktop.

When to use

Sidenav refers to the navigation UI that helps users access lower-level categories in the site’s information architecture. Those categories, or pages, are separate from the main menu. The user can navigate to those pages by clicking on the name of the category.

The goals are:

Minimum interaction cost

Users should be able to access an element of interest in the navigation with as little effort as possible.

Typical-path support

If, within a single session, users are likely to jump from a page in one section to another one in a completely different area of the site, subnavigation should make it easy.

Discoverability

Users should be able to find the subnavigation UI quickly, with no chance of confusing it with the main navigation.

  • Use links for navigation actions that appear within or immediately after a sentence.
  • Use buttons for actions that don’t appear within or directly following a sentence.

Anatomy

The subnavigation consists of:

  1. Label: communicates what is being linked to
  2. Icon (optional): this icon gives the label extra guidance
  3. Arrow: icon that shows there are underlying menu items
  4. Container

(Interactive) states

The subnavigation contains the states inactive, active, hover and focus.

Design properties

Typography

Large

  • Label inactive: TheSans/lg/400
  • Label active: TheSans/lg/700

Small

  • Label inactive: TheSans/md/400
  • Label active: TheSans/md/700

Colors

  • Label inactive: text color Grey/4
  • Label active: text color Blue/3
  • Icon inactive: svg color Grey/4
  • Icon active: svg color Blue/3
  • Arrow inactive: svg color Grey/4
  • Arrow active: svg color Blue/3

Interactive states

  • Hover inactive: label text color Blue/3
  • Focus: container border color Ocher/5

Structure

Icon, Icon + arrow, Icon + notification

Large
  • Label: padding-right 16px
  • Icon: height and width 20px, padding-right 16px
  • Arrow: height and width 24px
  • Container: height 48px
Small
  • Label: padding-right 16px
  • Icon: height and width 20px, padding-right 16px
  • Arrow: height and width 20px
  • Container: height 48px

Icon + arrow expanded

Large
  • Label: padding-right 8px
  • Icon: height and width 20px, padding-right 16px
  • Arrow: height and width 24px
  • Container: height 48px
Small
  • Label: padding-right 8px
  • Icon: height and width 20px, padding-right 16px
  • Arrow: height and width 20px
  • Container: height 48px

Accessibility

[technical requirements]

Content guidelines

  • The label need to be clear and predictable. Users should be able to anticipate where they will go when they select the label.
  • Always capitalize subnavigation labels, meaning that the first word is uppercase and the rest is lowercase (unless a term has its own name).
  • Labels should be short and sweet, with a maximum of 2 words.
  • Make labels easy to scan.
  • Figure out what users are looking for, and use category labels that are familiar and relevant. Menus are not the place to get cute with made-up words and internal jargon. Stick to terminology that clearly describes your content and features.
  • Avoid generic labels such as “Articles” or “Videos.” Such labels aren’t descriptive because they tell visitors the format of the content, but not the topic.

Best practices

Dos

The subnavigation must:

  • Show the pagenames the user can go to.
  • Have a logical order. You might want to sort the options by priority—start with top priority and end with the least important option.
  • Show the main navigational elements in size ‘large’ and the sub-elements in ‘small’ on mobile.
  • Have the badge behind the label if there is a notification within that element.
  • Use the expanded arrow when there are menu items underneath, with only one level of nested items allowed.

Don’ts

The subnavigation must:

  • Not create information overload.
  • Not have too many navigations, because options make the next step unclear.
  • Not show all navigational elements in one size if there is a difference between the main and sub-elements.

References

https://www.nngroup.com/articles/menu-design/ https://forgeandsmith.com/blog/website-navigation-ux-best-practices/ https://xd.adobe.com/ideas/process/information-architecture/website-navigation-design-best-practices/

版本与发布记录

@gemeente-denhaag/sidenav 共发布 245 个版本,首次发布于 2022/04/26;过去 12 个月发布了 0 个版本。

版本发布日期距今
2.0.0latest2025/02/251.7 年前
1.1.12025/02/191.7 年前
1.1.02025/01/231.8 年前
1.0.32025/01/221.8 年前
1.0.22025/01/211.8 年前
1.0.12025/01/131.8 年前

关于 @gemeente-denhaag/sidenav 的常见问题

@gemeente-denhaag/sidenav 是什么?

A sidenav component注意:该包已被作者标记为弃用——Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

如何安装 @gemeente-denhaag/sidenav?

在项目目录运行 npm install @gemeente-denhaag/sidenav,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(18 || 19)、react-dom(18 || 19)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@gemeente-denhaag/sidenav 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@gemeente-denhaag/sidenav 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@gemeente-denhaag/sidenav 可以商用吗?

@gemeente-denhaag/sidenav 使用 EUPL-1.2 许可。声明的许可为 EUPL-1.2,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@gemeente-denhaag/sidenav 的下载量有多少?

根据 npm 官方下载统计,@gemeente-denhaag/sidenav 在 2026/10/16 – 2026/11/14 这 30 天内被下载 7,953 次,日均约 265 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@gemeente-denhaag/sidenav 还在维护吗?

最新版本 2.0.0 发布于 2025/02/25(1.7 年前);至今共发布 245 个版本,其中过去 12 个月发布了 0 个;首次发布于 2022/04/26。作者已将其标记为弃用,新项目建议寻找替代方案。