SMARTBLOCKS

Create custom and programmable templates from within Roam!

Installation

You could use the Copy Extension button below to individually install this extension. To install, just paste anywhere in your Roam graph and click "Yes, I Know What I'm Doing".

Manual Installation

If the extension doesn't work after using the copy extension button above, try installing manually using the instructions below.

First create a block with the text {{[[roam/js]]}} on any page in your Roam DB. Then, create a single child of this block type three back ticks. A code block should appear. Copy this code and paste it into the child code block in your graph:

var existing = document.getElementById("roamjs-smartblocks-main");
if (!existing) {
  var extension = document.createElement("script");
  extension.src = "https://roamjs.com/smartblocks/main.js";
  extension.id = "roamjs-smartblocks-main";
  extension.async = true;
  extension.type = "text/javascript";
  document.getElementsByTagName("head")[0].appendChild(extension);
}

Finally, click "Yes, I Know What I'm Doing".

Overview

SmartBlocks makes it easy to reuse text in a dynamic way in Roam. It can be compared to other snippet/template insertion tools like TextExpander and Alfred. However, SmartBlocks completely lives in your Roam graph and can smartly interact with your graph. All SmartBlocks workflows are defined in the graph and are performed in your graph. SmartBlocks are made of the following key components:

  • Workflows: These are the definitions of what the SmartBlock will do, it serves as a template for the SmartBlocks actions. These can be predefined or custom workflows.

  • Commands: Commands are instructions that make your SmartBlock workflow do amazing and dynamic things.

  • Trigger: The keystrokes you type so that the workflow is run. The default keystroke is jj

Table of Contents

The following steps dive into all the features SmartBlocks has to offer in increasing complexity; from beginners to developer.

Demo

Migration

This extension was inspired by and acts as version 2 of the original smartblocks module in the Roam42 extension. It will soon replace the current smartblocks module in Roam42. For a list of all the non-backward compatible changes from V1 to V2, check out out Migration Guide.

Support

There is an active community at roamresearch.slack.com channels #roam42 and #roamjs discussing and building SmartBlocks. Stop by if you need help or want to share your ideas.



Contributors

This extension is brought to you by RoamJS! If you are facing any issues reach out to support@roamjs.com or click on the chat button on the bottom right. If you get value from using this extension, consider sponsoring RoamJS by clicking on the button below!

A special thanks to those who's contributions also helped make this extension possible:

Clevertech
Clevertech
πŸ’΅
Beau Haan
Beau Haan
πŸ’΅
Jorge Mir Alvarez
Jorge Mir Alvarez
πŸ’΅
Rahul Matthan
Rahul Matthan
πŸ’΅
David Rangel
David Rangel
πŸ’΅
Montgomery Kosma
Montgomery Kosma
πŸ’΅
David W Plummer
David W Plummer
πŸ’΅
Duane D Rudy
Duane D Rudy
πŸ’΅
Terese Brewster
Terese Brewster
πŸ’΅
Mattheus Peereboom
Mattheus Peereboom
πŸ’΅
Edwin Rooijakkers
Edwin Rooijakkers
πŸ’΅
Joey Harris
Joey Harris
πŸ’΅
Eric Peterson
Eric Peterson
πŸ’΅
Simon Nazer
Simon Nazer
πŸ’΅
Lance Tracey
Lance Tracey
πŸ’΅
Vincent Tam
Vincent Tam
πŸ’΅
Kenneth Bram
Kenneth Bram
πŸ’΅
Alan Ogle
Alan Ogle
πŸ’΅
Paul Hacker
Paul Hacker
πŸ’΅
John Trainor
John Trainor
πŸ’΅
Steve Greene
Steve Greene
πŸ’΅
Alex Young
Alex Young
πŸ’΅
Kaushal Kashyap
Kaushal Kashyap
πŸ’΅
Christopher Reath
Christopher Reath
πŸ’΅
Scott Block
Scott Block
πŸ’΅
Brian Barry
Brian Barry
πŸ’΅
Michael Ibara
Michael Ibara
πŸ’΅
Roy Temple
Roy Temple
πŸ’΅
Michael Marino
Michael Marino
πŸ’΅
Fadhilah Wahid
Fadhilah Wahid
πŸ’΅
Michael F. Byrne
Michael F. Byrne
πŸ’΅
Nate Stell
Nate Stell
πŸ’΅
Michael J D Ede
Michael J D Ede
πŸ’΅
Ravi Mandliya
Ravi Mandliya
πŸ’΅
Joseph Goodson
Joseph Goodson
πŸ’΅
Kara Monroe
Kara Monroe
πŸ’΅
Michael Brockbals
Michael Brockbals
πŸ’΅
Margaret K Delano
Margaret K Delano
πŸ’΅
Jacques Gautreau
Jacques Gautreau
πŸ’΅
David R Schulman
David R Schulman
πŸ’΅
Mike Judd
Mike Judd
πŸ’΅
Jessica DeVita
Jessica DeVita
πŸ’΅
Andreas Von Gunten
Andreas Von Gunten
πŸ’΅
Solomon Weiler
Solomon Weiler
πŸ’΅
Jessica Shieh
Jessica Shieh
πŸ’΅
Ray Nestor
Ray Nestor
πŸ’΅
Keenan Payne
Keenan Payne
πŸ’΅
Mark Bulling
Mark Bulling
πŸ’΅
William R Petro
William R Petro
πŸ’΅
MAGNUS HELGERUD SØRBY
MAGNUS HELGERUD SØRBY
πŸ’΅
Behrooz Bashokooh
Behrooz Bashokooh
πŸ’΅
Jacques Tardie
Jacques Tardie
πŸ’΅
JonΒ Surrat
JonΒ Surrat
πŸ’΅
Matthew J Brockwell
Matthew J Brockwell
πŸ’΅
JC Cangilla
JC Cangilla
πŸ’΅
Peter Rosso
Peter Rosso
πŸ’΅
Christoph Weniger
Christoph Weniger
πŸ’΅
Benjamin D.
Benjamin D.
πŸ’΅
ANDREW C MACOMBER
ANDREW C MACOMBER
πŸ’΅
Habib Sayah
Habib Sayah
πŸ’΅
Vaibhav Chadha
Vaibhav Chadha
πŸ’΅
Sabi Sika Boni Guessou
Sabi Sika Boni Guessou
πŸ’΅
TH.J.M. Koster
TH.J.M. Koster
πŸ’΅
Tony Lembke
Tony Lembke
πŸ’΅
Christopher Boyer
Christopher Boyer
πŸ’΅
Gallet
Gallet
πŸ’΅
Michael Norrie
Michael Norrie
πŸ’΅
Adam Naudascher
Adam Naudascher
πŸ’΅
Jack Montoya Jr.
Jack Montoya Jr.
πŸ’΅
Karaminder Ghuman
Karaminder Ghuman
πŸ’΅
Dr S Hill
Dr S Hill
πŸ’΅
Scott Ian Taylor
Scott Ian Taylor
πŸ’΅
TALI LERNER
TALI LERNER
πŸ’΅
Giovanni Faga
Giovanni Faga
πŸ’΅
g.a. Epping
g.a. Epping
πŸ’΅
Milan Stanojevic
Milan Stanojevic
πŸ’΅
RB Mulholland
RB Mulholland
πŸ’΅
David Wilson
David Wilson
πŸ’΅
Asaf Dafna
Asaf Dafna
πŸ’΅
Billy Linder
Billy Linder
πŸ’΅
S Venkatesan
S Venkatesan
πŸ’΅
Russell Pasetes
Russell Pasetes
πŸ’΅
Cherry Sun
Cherry Sun
πŸ’΅
David Weiss
David Weiss
πŸ’΅
Larry Bernstein
Larry Bernstein
πŸ’΅
Mridula Duggal
Mridula Duggal
πŸ’΅
TSUKASA GOZAOKA
TSUKASA GOZAOKA
πŸ’΅
LE NGOC QUOC HUY
LE NGOC QUOC HUY
πŸ’΅
Sangmin Ahn
Sangmin Ahn
πŸ’΅
Merril Pious Jacob
Merril Pious Jacob
πŸ’΅
Arlen Hooley
Arlen Hooley
πŸ’΅
W M Tappin
W M Tappin
πŸ’΅
Daniel helou rahal
Daniel helou rahal
πŸ’΅
Ashwin Siddarth
Ashwin Siddarth
πŸ’΅
Joseph A Moody
Joseph A Moody
πŸ’΅
Tsao Jian-hsiung
Tsao Jian-hsiung
πŸ’΅
Nigel Rawlins
Nigel Rawlins
πŸ’΅
Scott Fry
Scott Fry
πŸ’΅
Akhilender Singh
Akhilender Singh
πŸ’΅
YU KUWANO
YU KUWANO
πŸ’΅
Matthew Mckinlay
Matthew Mckinlay
πŸ’΅
Aleksey Tentler
Aleksey Tentler
πŸ’΅
SANTOSH ANGADI
SANTOSH ANGADI
πŸ’΅
Andre Foeken
Andre Foeken
πŸ’΅
John Gulledge
John Gulledge
πŸ’΅
Jordan Burton
Jordan Burton
πŸ’΅
TsunKuo Kuo
TsunKuo Kuo
πŸ’΅
Ami Pedahzur
Ami Pedahzur
πŸ’΅

ROAMJS DIGEST

Add your email below to stay up to date on all RoamJS features, fixes, and news!

Other Extensions