Skip to content

feat: add image control options (disable download/hover on images)#514

Open
sleitor wants to merge 1 commit intovercel:mainfrom
sleitor:feat/image-controls
Open

feat: add image control options (disable download/hover on images)#514
sleitor wants to merge 1 commit intovercel:mainfrom
sleitor:feat/image-controls

Conversation

@sleitor
Copy link
Copy Markdown
Contributor

@sleitor sleitor commented Apr 23, 2026

Summary

Adds image to the controls prop, allowing users to disable the hover overlay and download button on images.

Closes #511

Usage

// Disable all image controls (hover overlay + download)
<Streamdown controls={{ image: false }}>{content}</Streamdown>

// Disable only the download button (keeps hover overlay)
<Streamdown controls={{ image: { download: false } }}>{content}</Streamdown>

Changes

  • Extended ControlsConfig type to include image?: boolean | { download?: boolean }
  • Added shouldShowImageControl helper following the existing mermaid/code/table pattern
  • Updated MemoImg wrapper to read controls from context and pass props to ImageComponent
  • Updated ImageComponent to accept showControls and showDownloadControl props
  • Added test coverage for all new control combinations
  • Added changeset (minor bump)

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Apr 23, 2026

@sleitor is attempting to deploy a commit to the Vercel 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.

Add image control options

1 participant