[go: up one dir, main page]

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

🧩 logseq.App.registerUIItem #25

Open
utterances-bot opened this issue Jul 13, 2024 · 1 comment
Open

🧩 logseq.App.registerUIItem #25

utterances-bot opened this issue Jul 13, 2024 · 1 comment

Comments

@utterances-bot
Copy link

https://plugins-doc.logseq.com/logseq/App/registerUIItem

Copy link
YU000jp commented Jul 13, 2024

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


}

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