-
Notifications
You must be signed in to change notification settings - Fork 111
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 to style custom buttons in the menu bar? #169
Comments
There is an example of a custom menu button with just an icon and no text here: https://github.com/josdejong/svelte-jsoneditor/blob/main/src/routes/examples/custom_menu_buttons/%2Bpage.svelte By default, the button will be styled like the other buttons in the menu of the editor. You can give the button a It is not possible to create dropdown menu though like in the screenshot you post from https://jsoneditoronline.org/. The repo of jsoneditoronline is not public though, but it has a custom dropdown menu component for this second menu bar. |
@josdejong thanks for your reply. I installed FontAwesome for my Vue app and I'm trying to reproduce your linked Svelte example. I started with this <script setup lang="ts">
import type { FontAwesomeIcon } from "vanilla-jsoneditor";
import { faCopy } from '@fortawesome/free-regular-svg-icons';
const myIcon: FontAwesomeIcon = {
prefix: faCopy.prefix,
iconName: faCopy.iconName,
icon: faCopy.icon // this is not possible
};
</script> I can't assign
|
Good point. I had some troubles with the type definitions of fontawesome and created my own definition |
I've fixed the issue via 9d693f9 (not yet published) |
Thanks for your efforts :) Do you have any plans when this will be released? |
👍 I've published the fix now in |
Working perfectly fine :) |
I tried to setup a "download" button that should appear in the menu bar
Unfortunately it looks like
I want it to look like the original one ( taken from here https://jsoneditoronline.org/ )
Would you mind telling me what's wrong/missing? Is there a public repository for jsoneditoronline I can have a look at?
It would be fine for me if there is no text, just the icon as a button!
The text was updated successfully, but these errors were encountered: