facebook / facebook/docusaurus

Support for Expanding/Zooming Images and Diagrams

Đang mở
#10,883 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
feature status: needs triage
Ngôn ngữ chính
TypeScript
Star
66.2k
Fork
10k
Merge trung bình
1 ngày 3 giờ
Pull request đã merge (30 ngày)
52

Mô tả

### Have you read the Contributing Guidelines on issues?

- [x] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Description

I would like to request a feature that allows users to expand or zoom in on images and diagrams within Docusaurus documentation. This would improve the readability of detailed diagrams, code snippets in screenshots, and other important visual elements.

### Has this been requested on Canny?

https://docusaurus.io/feature-requests/p/support-for-expanding-zooming-images-and-diagrams

### Motivation

Many documentation sites use images to convey complex information. However, without a built-in zoom/expand functionality, users often struggle to view intricate details, especially on smaller screens.

### API design

Proposed Solution:

- Lightbox Integration: Implement a lightbox-style viewer that allows users to click on an image to expand it in an overlay.
- Zoom on Hover/Click: Provide an option to enable zooming functionality when hovering over or clicking on an image.
- Configurable via Markdown or Frontmatter: Allow users to specify whether an image should be expandable within MDX files or frontmatter settings.
- Mobile-Friendly Implementation: Ensure touch-friendly support for mobile users (e.g., pinch-to-zoom, double-tap zooming).

Potential Implementations:

- Utilize a lightweight JavaScript library like [medium-zoom](https://github.com/francoischalifour/medium-zoom) or a native React component.
- Add a built-in component with zoom functionality that users can opt into.
- Provide a global setting in docusaurus.config.js to enable/disable this feature.
- https://nextra.site/docs/guide/image#image-zoom

Alternatives Considered:

- Manually linking images to open in a new tab (not user-friendly and disrupts navigation).

### Have you tried building it?

no

### Self-service

- [ ] I'd be willing to contribute this feature to Docusaurus myself.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.