Skip to content

Button block syntax

Button block syntax refers to the specific code format used to generate interactive buttons within the Obsidian note-taking application, typically enabled by a community plugin.^[600-developer-tools-obsidian-obsidian-buttons-create.md]

The syntax requires creating a code block labeled button and defining parameters within the block to configure the button's behavior and appearance^[600-developer-tools-obsidian-obsidian-buttons-create.md].

Syntax Structure

The button is created using a fenced code block. The block must start with three backticks followed immediately by the keyword button. The configuration parameters are placed inside the block, followed by the closing backticks^[600-developer-tools-obsidian-obsidian-buttons-create.md].

A unique identifier, such as ^button-name, is typically appended immediately after the code block to anchor the button in the document^[600-developer-tools-obsidian-obsidian-buttons-create.md].

Parameters

Various parameters can be placed inside the code block to customize the button:

  • name: Defines the text label displayed on the button^[600-developer-tools-obsidian-obsidian-buttons-create.md].
  • type: Specifies the action type of the button. For example, setting it to link allows the button to open a URL^[600-developer-tools-obsidian-obsidian-buttons-create.md].
  • action: Determines the target of the action. When combined with type link, this parameter accepts a URL, such as a GitHub repository page^[600-developer-tools-obsidian-obsidian-buttons-create.md].
  • color: Sets the visual color of the button (e.g., blue)^[600-developer-tools-obsidian-obsidian-buttons-create.md].
  • templater: A boolean flag (e.g., true) that can be enabled to integrate with the Templater plugin^[600-developer-tools-obsidian-obsidian-buttons-create.md].

Examples

Basic Button

The following syntax creates a button labeled "Btn":^[600-developer-tools-obsidian-obsidian-buttons-create.md]

```button
name Btn
```
^button-zcju

This example creates a blue button that links to an external GitHub repository, utilizing Templater integration:^[600-developer-tools-obsidian-obsidian-buttons-create.md]

```button
name github-buttons
type link
action https://github.com/shabegom/buttons
templater true
color blue
```
^button-forum-github

Sources

  • 600-developer-tools-obsidian-obsidian-buttons-create.md