Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I manually target Image Extension in this editor #124

Open
sagarpadia7 opened this issue Dec 19, 2024 · 3 comments
Open

How can I manually target Image Extension in this editor #124

sagarpadia7 opened this issue Dec 19, 2024 · 3 comments

Comments

@sagarpadia7
Copy link

Can someone help me manually target the Image Extension in the editor? I don’t want to display the toolbar, and I want to achieve this using a custom input button instead of showing the modal. How can I target the same Image Extension functionality using my custom button?

Screenshot 2024-12-19 104054

@hunghg255
Copy link
Owner

you can reference this code https://github.com/hunghg255/reactjs-tiptap-editor/blob/main/src/extensions/Image/Image.ts
Create an extension image for yourself

@sagarpadia7
Copy link
Author

I can create my own extension, but I want the same functionality as yours. Specifically, I want to target the image functionality without the toolbar, as shown in the image below. I just need it with the gallery button.

image

@hunghg255
Copy link
Owner

hunghg255 commented Dec 19, 2024

I can create my own extension, but I want the same functionality as yours. Specifically, I want to target the image functionality without the toolbar, as shown in the image below. I just need it with the gallery button.

image

you can add option toolbar=false to hidden extension on toolbar

toolbar?: boolean

import { Image } from 'reactjs-tiptap-editor'; 

const extensions = [
  ...,
  // Import Extensions Here
  Image.configure({
     toolbar: false
  }),
];

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

No branches or pull requests

2 participants