Skip to content

Button code block syntax

The Button code block syntax is used with the Buttons plugin for Obsidian to create interactive buttons within notes.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]

Syntax Structure

Buttons are created using a code block labeled button. The parameters defining the button's behavior and appearance are placed inside this block.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]

Parameters

The following parameters are supported within the code block:

  • name: Sets the text label displayed on the button.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]
  • type: Specifies the type of button, such as link to open a URL.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]
  • action: Defines the target URL or action to be executed when the button is clicked.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]
  • color: Sets the color of the button (e.g., blue).^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]
  • templater: A boolean flag (e.g., true) used to enable integration with the Templater plugin.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]

Examples

Basic Button

A minimal button definition requires only a name.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]

```button
name Btn
```

A button that opens a specific URL can be created by setting the type to link, providing the action, and optionally styling it with a color.^[600-developer__tools__obsidian__obsidian-buttons-create.md, 200-ob-plugin-buttons.md]

```button  
name github-buttons
type link
action https://github.com/shabegom/buttons
color blue
```
  • [[Obsidian]]
  • [[Templater]]

Sources

  • 600-developer__tools__obsidian__obsidian-buttons-create.md
  • 200-ob-plugin-buttons.md