Open utterances-bot opened 4 months ago
Kit for making a toolbar button
const keyButton = "UniqueKeyHere" // Creating a unique key for the button
// Create a button
logseq.App.registerUIItem('toolbar', {
key: keyButton,
template: `
<div>
<a class="button icon" data-on-click="${keyButton}" id="${keyButton}" style="font-size: 16px" title="Tooltip comment here">🏳️🌈</a>
</div>
`,
})
// Event
logseq.provideModel({
[keyButton]: () => eventA(),
})
const eventA = () => {
//Process when button is pressed here
}
https://plugins-doc.logseq.com/logseq/App/registerUIItem