Skip to content

Enhance CodeTabs tab naming #8549

Closed
Closed

Description

@canerakdas

The tab naming in our current CodeTabs component isn’t very descriptive and doesn’t clearly indicate that the displayed code is an example. This can be confusing for screen reader users and for people who are new to the ecosystem

Renaming them to something like Example CJS, Example MJS, and displaying the type separately could be more intuitive.

  • Since this improvement is implemented in the ui-components package and indirectly affects doc-kit as well, it should also cover scenarios like ESM (2), CJS (2), JS etc.

The design can be reviewed in Figma (apologies in advance for my terrible Figma skills 😅).

Image

Activity

  1. naveenkarmegam commented on Jan 14, 2026

    @naveenkarmegam
    Contributor

    This makes a lot of sense — the current tab labels aren’t very descriptive, especially for screen readers and for developers who are new to the Node.js ecosystem. Shall i proceed ?

  2. avivkeller commented on Jan 15, 2026

    @avivkeller
    Member

    I'm afraid I don't understand this, why should we give every code box the same name (Example), aren't they assumed to be examples already?

  3. ovflowd commented on Jan 15, 2026

    @ovflowd
    Member

    I'm afraid I don't understand this, why should we give every code box the same name (Example), aren't they assumed to be examples already?

    Not every codebox. It allows us to add actual titles to the CodeBoxes and keep the "language tag". Right now in most we're just saying ESM/CJS but that isn't much clear. Imagine if you have a CodeBox with 4 tabs CJS, MJS, CJS, MJS... It becomes confusing what it is. So naming it as Example 1 (CJS), Example 1 (MJS), Example 2 (CJS), Example 2 (MJS) makes it easier to understand.

  4. avivkeller commented on Jan 15, 2026

    @avivkeller
    Member

    Ahhh, I see. So, to clarify, we are putting the language in a secondary label if a custom displayTitle is specified

  5. ovflowd commented on Jan 15, 2026

    @ovflowd
    Member

    Ahhh, I see. So, to clarify, we are putting the language in a secondary label if a custom displayTitle is specified

    I guess? It really depends on implementation, hence why I'm unsure if #8552 is actually a proper solution implementation-wise.

  6. moved this from 📋 Backlog to ✅ Done in Node.js Websiteon Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions