Skip to content

feat: Option to position sidebar on the right (close #1282)#2726

Open
mitre88 wants to merge 1 commit intodocsifyjs:developfrom
mitre88:feature/sidebar-position-right
Open

feat: Option to position sidebar on the right (close #1282)#2726
mitre88 wants to merge 1 commit intodocsifyjs:developfrom
mitre88:feature/sidebar-position-right

Conversation

@mitre88
Copy link
Copy Markdown

@mitre88 mitre88 commented May 4, 2026

Summary

This PR implements the feature requested in issue #1282 - the ability to position the sidebar on the right side of the content.

Changes

  1. New Config Option: Added sidebarPosition option to config that accepts 'left' (default) or 'right'

  2. CSS Implementation: Updated sidebar styles to handle right-side positioning with proper borders, transitions, and mobile responsive behavior

  3. JavaScript Integration: Set data-sidebar-position attribute on body element based on config

Usage

window.$docsify = {
  sidebarPosition: 'right'  // sidebar appears on the right
}

Files Changed

  • src/core/config.js - Added sidebarPosition config option
  • src/core/render/index.js - Set body attribute based on config
  • src/themes/shared/_sidebar.css - Right-side positioning styles
  • src/themes/shared/_app.css - Content offset for right sidebar
  • src/themes/shared/_mq.css - Mobile responsive fixes for right sidebar

Use Cases

  • RTL (right-to-left) language support
  • Personal preference for right-side navigation
  • Flexibility in documentation layout

Closes #1282

Adds a new config option 'sidebarPosition' that accepts 'left' (default)
or 'right' to position the sidebar on either side of the content.

This feature is useful for:
- RTL (right-to-left) language support
- Personal preference for right-side navigation

Usage:
window.$docsify = {
  sidebarPosition: 'right'
}

Closes docsifyjs#1282
@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

@nishantpurohit04 is attempting to deploy a commit to the Docsify Team on Vercel.

A member of the Team first needs to authorize it.

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.

option to put sidebar on the right

1 participant