plugins
plugins copied to clipboard
🧩 logseq.App.registerUIItem
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
}