shabegom388k downloadsCreate Buttons in your notes to run commands, open links, and insert templates.
Run commands and open links by clicking on ✨ Buttons ✨
Read the Documentation for more information
last updated: August 2, 2025
0.9.4
{} or [] delimiters (Luca-Harrison)width and height arguments (in em units) (Luca-Harrison)align argument (left/center/right + top/middle/bottom) (Luca-Harrison)You can find Buttons in the list of community plugins!
The quickest way to get started with Buttons is to use the Button Maker. You can open the Button Maker from the Command Palette. Here is an overview of the Button Maker options.
[id1, id2] (for more information on Swap Buttons, see below).[id1, id2].[startingLine, endingLine].true you can include a Templater command inside your button. The command will be converted to its value when the button is clicked and converted back to the command after. This cannot be used with Inline Buttons.{} or [] delimiters with full markdown support for formatting.width argument (in em units), e.g., width 15.height argument (in em units), e.g., height 3.align with horizontal (left/center/right) and vertical (top/middle/bottom) options, e.g., align center middle.The button-block-id is a block-id placed direcly below a Button codeblock and starts with button, e.g. ^button-id. Button-block-ids can be used to:
button-button1swap [button1, button2]id button1remove [button1, button2] argumentInline Buttons can be created inline with other text, or other Buttons. An Inline Button is essentially a copy of an existing Button codeblock placed inline. To create an inline button:
button-id.Inline Buttons must start with button, whereas other usages of the button-block-id only require the id.
A Swap Button is a special type of Inline Button. When you click a Swap Button it cycles through multiple other Buttons. Use a Swap Button to run a succession of actions with one Button. To Create a Swap Button:
swap [id1, id2, id3]. Ensure the Swap Button has a unique button-block-id.Swap Buttons can currently only be used as Inline Buttons.
A Chain Button allows you to run multiple actions in sequence with a single click. Each action can be any supported button type (command, text, template, link, calculate, copy, or even another chain).
Syntax:
name Manage Field
type chain
actions [
{"type": "append text", "action": "exercise::"},
{"type": "command", "action": "Metadata Menu: Manage field at cursor"}
]
^button-manage-field
actions field must be a valid JSON array of objects, each with a type and action.Example:
name Daily Setup
type chain
actions [
{"type": "command", "action": "Periodic Notes: Open today's daily note"},
{"type": "append text", "action": "## Tasks for Today"},
{"type": "template", "action": "Daily Task Template"}
]
^button-daily-setup
How to Create:
Notes:
actions field must be valid JSON. If you edit by hand, use a JSON validator if you run into issues.type must be one of the supported text button types: append text, prepend text, line(1) text, line(+1) text, line(-1) text, or note text.line(5)) and relative (line(+2), line(-1)) positioning.If you are using the same (or similar) Buttons across many notes, you can create one parent Button and have other Buttons inherit from the parent.
id parentButton.Child Buttons can also have their own arguments. Any argument supplied on the Child supersedes arguments from the Parent Button.
The Templater arg allows you to supply a Templater command inside the Button. The command is converted to its value when the Button is clicked and then converted back to the Templater Command for the next click. This is best used with the New Note Button type.
A button with this command…
```button
name Make an Hourly Note
type note(<% tp.date.now("HH:MM") %>) template
action Log Template Note
templater true
```
…will convert when clicked to:
```button
name Make an Hourly Note
type note(16:20) template
action Log Template Note
templater true
```
And then 09 will change back to <% tp.date.now("HH:MM") %>.
The Templater arg also works with the Text Button type:
```button
name Add Current Time
type line(1) text
action <% tp.date.now("HH:mm:ss") %>
replace [1,1]
templater true
```
This will insert the current time on line one of the note, replacing any existing text on that line and then convert back to the Templater command for future use.
Install the Style Settings plugin for an easy way to change the default Button styling.
If you want a truly custom style, or want Buttons with multiple different styles, you can add a class argument in a Button and use a css snippet to style it.
If you have a Button that only needs to run once and then can be removed from a note (handy for inserting prompts into a Daily Note) you can add a remove true argument to your Button.
If you have multiple Buttons in a note and want to remove them all when a Button is clicked, you can supply an array of button-block-ids to the remove argument, e.g. remove [id1, id2, id3].
When using Template or Text Buttons, you can remove lines from the existing note which will be replaced by new content. Use the replace argument with absolute or relative line numbers:
replace [1, 5] removes lines 1 through 5replace [+1, +3] removes 3 lines starting 1 line after the buttonreplace [10, +5]Relative positioning is perfect for portable templates that work regardless of where they're placed in your document.
Open the previous day's daily note using the Periodic Notes Plugin:
```button
name Open Previous Daily Note
type command
action Periodic Notes: Open previous daily note
```
^button-previous
Turn spellcheck on/off:
```button
name Toggle spellcheck
type comand
action Toggle spellcheck
color blue
```
^button-spellcheck
Open the Obsidian Forum:
```button
name To the Forum Batman!
type link
action https://forum.obsidian.md/
```
^button-forum
Append a Log Template Note:
```button
name Log
type append template
action Hourly Log Template Note
```
^button-log
Append the current time:
```button
name Log
type append text
action <% tp.date.now("HH:mm") %>
templater true
```
Replace a Weather Template Note with the updated Weather:
```button
name Current Weather
type prepend template
action Weather Template Note
replace [1,5]
```
^button-weather
Prepend a weekly todo list and remove other buttons:
```button
name Monday List
type prepend template
action Monday Template Note
remove [mon,tues,wed]
```
^button-mon
```button
name Tuesday List
type prepend template
action Tuesday Template Note
remove [mon,tues,wed]
```
^button-tues
```button
name Wednesday List
type prepend template
action Wednesday Template Note
remove [mon,tues,wed]
```
^button-wed
Even better, set up those buttons and then add them all on one line as Inline Buttons:
`button-mon` `button-tues` `button-wed`
Insert templates at specific lines using absolute or relative positioning:
```button
name Current Weather (Absolute)
type line(1) template
action Weather Template Note
replace [1,5]
```
^button-weatherLine-absolute
Perfect for portable templates that work anywhere in your document:
```button
name Current Weather (Relative)
type line(+1) template
action Weather Template Note
replace [+1,+3]
```
^button-weatherLine-relative
Create a new note in a new split pane for an upcoming meeting based on a Meeting Note Template:
```button
name New Meeting
type note(Meeting, split) template
action Meeting Note Template
```
^button-meeting
Dynamically add the hour and minute to the note title and open as a new tab:
```button
name New Meeting
type note(Meeting-<%tp.date.now("HH-MM") %>, tab) note
action Meeting Note Template
templater true
```
^button-meeting2
Do some simple math:
```button
name Add Em Up
type calculate
action 2+2
```
^button-add
Reference numbers outside of the Button:
Bananas Have: 5
Bananas Lost: 5
```button
name How Many Bananas Today?
type calculate
action $1-$2
color yellow
```
^button-bananas
Natural Language Math:
5 dogs plus 2 cats divided by 2 people
```button
name Who Get The Pets?
type calculate
action $1
class sad-button
```
^button-breakup
The calculate button uses math-expression-evaluator, so it should support any symbol supported by that library.
```button
name {
🚀 **Launch Process**
*Execute with style*
→ Click to proceed
}
type command
action Toggle Pin
width 18
height 4
align center middle
```
^button-formatted
```button
name Action Button
type command
action Toggle Pin
width 12
height 2
align right top
color blue
```
^button-sized
Let's create a Swap Button using the button-block-id of previous Buttons:
```button
name Crazy Swap Button
swap [add,meeting,forum]
```
^button-swap
Then insert that button inline:
`button-swap`
Note: swap count is reset if you close the note.
line(+N) and line(-N) syntax for text and template buttonsreplace [+N,+M] functionalitytemplater option (Lx)remove option (Lx)swap: use the swap [id1, id2, id3] arg along with an inline button to create a button that performs multiple actions on each clicktemplater: the templater arg allows you to put a templater command inside a button. When the button is clicked the templater command is converted to it's value and then is converted back to the templater command: note(<% tp.date.now("MM-DD") %>) templateremove can now be an array of button block-ids to remove (it can still be true to remove the clicked button)replace now takes an array like [startLine,endLine] to define the start and end line to be replaced.append, prepend, remove, replace have been updated to use the button position. name is no longer required.- and ! and other characters in their title.note(Note Name, split) templatecalculate button type that can do maths and output resultscalculate can reference numbers outside the button by their line numberreplace argument that replaces content between a specified header and the buttonnote() template feature that will create a new note based on a specified templatetemplate button typeremove argument that removes the button after it is clicked