Index of every page on this site: llms.txt
All skills
abdurshd avatar

/sidebar-x

@b47f145
Run it yourself

Designs and implements a console sidebar that stays the same shape on every page, with clear menus and submenus, a pinned bottom zone for organization, platform and account concerns, an application zone that is never empty, admin-controlled visibility, an icon rail and a mobile drawer. Use when a product's sidebar changes shape as people move between an application, its settings, the organization and the account, when a settings area opens its own sidebar, when operators cannot tell where they are, or when building the navigation of a new admin console, SaaS control plane or dashboard. Adapts to single-user tools, single-tenant apps with an admin, and multi-tenant organization-to-application products. Framework-neutral and stateless; maps onto the host project's own design tokens.

Use this Skill: https://skilld.dev/gh/abdurshd/skills/sidebar-x

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesanatomy-and-tokens.md

≈1.4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Anatomy and tokens

The rail is one raised card inset on the page ground. Everything inside it uses the host project's semantic tokens; the names below are the roles to map, not new values to introduce. If the project has no token for a role, add the token to the project's system rather than hard-coding a value in the rail.

Token roles

Role Used for Typical host token
rail.width expanded width 224px (range 216–240)
rail.width.collapsed icon rail 56px
rail.gap inset from the viewport and from the workspace 8px
rail.radius card corners the project's card radius
surface.primary rail background card surface
surface.secondary hover, switcher background muted surface
surface.accent-soft current entry background soft accent
text.primary / text.secondary / text.tertiary labels / idle rows / eyebrows and guide-line chevrons body, secondary, tertiary text
text.accent current entry label and icon accent
separator zone divider, submenu guide line hairline
focus-ring keyboard focus, outline: 2px solid; outline-offset: 2px the project's focus ring
shadow.raised the rail card raised shadow
shadow.panel the account menu floating panel shadow
font.body-medium menu labels 13–14px medium
font.caption-medium submenu and pinned-section entries 12px medium
font.caption-eyebrow zone and section eyebrows 10–11px semibold, uppercase, 0.08em tracking
duration.fast / ease chevron rotation, hover the project's fast duration

Light and dark themes come for free when every color above is a semantic token. Never branch on theme inside the rail.

Rows

Menu row (working zone and pinned section entries):

[icon 16] [label ..................] [chevron 14, only with submenu]
height 34 (44 on touch), padding 0 10, radius rail.radius-sm, gap 10
idle: text.secondary; hover: surface.secondary + text.primary
current: surface.accent-soft + text.accent, label 600, icon stroke slightly heavier
menu containing the current page (submenu open): label text.primary 600, no background

Submenu row:

   |  [label ..................]
   indented 19 from the menu icon, guide line 1px separator on the left, 10 padding after it
   height 30 (40 on touch), font caption-medium, no icon
   current: surface.accent-soft + text.accent

The chevron is its own button (26×26, aria-expanded, aria-controls, label "Expand X" / "Collapse X"). The menu label is a link to the menu's own page. Clicking the label also opens the submenu; only the chevron closes it.

Pinned section head:

[icon 16] [EYEBROW small / Name strong] ............ [chevron]
height 36, same hover as a menu row, no current background: the entries inside carry it
open: chevron rotated 180°, entries listed as submenu rows with 15px icons

Account row (foot of the rail):

[avatar 32] [name strong / email small] [chevrons 13]
button, not a link; opens the account menu upward, anchored to the row
current on the account page: accent border and soft accent background

Account menu: profile header (avatar, name, email, current tenant chip), then Profile, Security or Passkeys, Sessions, Appearance, theme toggle, Sign out. Nothing that already has a place in the rail (no platform administration, no organization settings).

Zones

  • Working zone: display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: thin. Head holds the eyebrow ("APPLICATION", "PROJECT") and the switcher (a select with the context's favicon as media) or a static row when there is only one context.
  • Pinned zone: flex: none, separated by a 1px separator with 8px padding above.
  • On path change, scroll the entry with aria-current="page" into view with block: "nearest" so a long tree never opens with the current page below the fold.

Collapsed rail

  • Width rail.width.collapsed; brand mark only; the context switcher becomes the context favicon (22px, accent-soft fallback with the initial) linking to the context's first page.
  • Menu rows show the icon only, centered; the label stays in the DOM for the accessible name and is visually hidden; each link gets title for pointer users.
  • Submenus are not rendered. Pinned sections become one icon each, linking to the section's first entry.
  • The account menu opens to the right of the row instead of above it.
  • Toggle with a topbar button and the [ key (ignored while typing in an input). Persist per browser.

Mobile drawer (≤ 820px)

  • The rail becomes a drawer flush with the viewport edge, 300px or 100vw − 44px, with a scrim, a close button, focus trapped inside, role="dialog", and body scroll locked.
  • Collapse and focus mode do not apply below this width.
  • Row heights rise to 44 (menus) and 40 (submenus).

Full-width pages (focus mode)

Editors and assistants may drop the rail. Decide it from the path with one pure function, leave a Back link in the topbar that returns to the list the editor came from, and let the rail be revealed per page without persisting that choice.

Topbar

The topbar holds the rail toggle, the breadcrumb trail, the context selectors that change what a page shows (environment, date range belong to the page, not the topbar), search, and notifications. It does not hold the account avatar: the account lives at the foot of the rail. Give the trail column minmax(0, 1fr) and cap the search column so a four-level trail is not truncated at common desktop widths.

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides a framework for designing and implementing consistent UI sidebars. It includes architectural guidelines and reference code that emphasize security best practices, such as server-side authorization and administrative auditing. No malicious behaviors or vulnerabilities were identified.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at b47f145. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated 2 months ago

README badge

README badge for abdurshd/skills/sidebar-x