Skip to content

Toolbar button order #102

Answered by igordanchenko
Flo2410 asked this question in Q&A
Mar 31, 2023 · 1 comments · 3 replies
Discussion options

You must be logged in to vote

Thank you for posting this great question. As of today, there is no elegant way to change the order of buttons added through the toolbar.buttons prop and the ones added by plugins. Each plugin prepends its button to the beginning of the toolbar.buttons array, so you can easily re-arrange plugin buttons by changing the order of the plugins. However, plugin buttons would always appear to the left of the buttons you add through the toolbar.buttons prop, and the only way to change this is to add your own buttons via a custom plugin as well. Here is how you'd do it.

import * as React from "react";
import { Lightbox, Plugin } from "yet-another-react-lightbox";
import { useLightboxState } from "…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Flo2410
Comment options

@igordanchenko
Comment options

@Flo2410
Comment options

Answer selected by Flo2410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants