Skip to content

Obsidian button syntax

Obsidian button syntax generally refers to the code blocks used to create interactive buttons within the Obsidian note-taking application.^[600-developer__tools__obsidian__Obsidian-admonition.md]

Syntax

Buttons are created using a specific code block format. The core syntax involves defining the button's name, the type of action it triggers, the specific command to execute, and its visual appearance.^[600-developer__tools__obsidian__Obsidian-admonition.md]

The syntax structure is as follows^[600-developer__tools__obsidian__Obsidian-admonition.md]:

```button
name <Label Text>
type <command>
action <Command ID>
color <Color Name>
```

Properties

  • name: Sets the text label displayed on the button.^[600-developer__tools__obsidian__Obsidian-admonition.md]
  • type: Specifies the function type; commonly command to trigger internal Obsidian commands.^[600-developer__tools__obsidian__Obsidian-admonition.md]
  • action: Identifies the specific command ID to be executed (e.g., Toggle spellcheck).^[600-developer__tools__obsidian__Obsidian-admonition.md]
  • color: Defines the visual color of the button (e.g., red).^[600-developer__tools__obsidian__Obsidian-admonition.md]

Example

The following syntax creates a button that toggles the spellcheck feature and displays it in red^[600-developer__tools__obsidian__Obsidian-admonition.md]:

```button
name Toggle spellcheck
type command
action Toggle spellcheck
color red
```

Sources

  • 600-developer__tools__obsidian__Obsidian-admonition.md