Build Your Own Widgets for Obsidian Canvas

Build widgets that give you a quick-look into your daily and weekly notes, and display them beautifully within Canvas.

Build Your Own Widgets for Obsidian Canvas
Photo by Glen Carrie / Unsplash
👋🏻
Are you just getting started with Obsidian? If so, our Obsidian Essentials e-book can help you get off the ground running. Want to be involved? You can even suggest content if you're interested in learning a specific topic. Find out more here.

Alright, it's time to have some fun now.

I'm going to call these widgets, because I like to use Canvas as a dashboard of sorts. On top of my active queries that pick up tags littered throughout my vault, I wanted some additional queries that picked up the notes that I created or modified in the last week, as well as within the current day.

Being able to visualize these notes from the bird's eye view that is Canvas enables/forces me to look back on my work, while also serving as a reminder for potential missed actionables, should I fail to tag anything appropriately throughout the day.

These widgets function using Dataview, and I'll walk you through how I have them configured.

If you recall, I just have one note that houses all of my queries for Canvas, so I'll continue to use that here. Use the following code to capture your Weekly notes.

dataview
table without id
file.link as Note,
file.folder as Folder,
file.mtime as "Last Modified"
FROM -"Dailies"

where file.mtime > (date(now) - dur(7 days))
sort file.mtime desc

Let's break this down line by line:

The Daily note version is essentially the same, but I adapt the WHERE clause to only pick up notes created or modified last 12 hours. You can change this to whatever you want.

dataview
table without id
file.link as Note,
file.folder as Folder,
file.mtime as "Last Modified"
FROM -"Dailies"

where file.mtime > (date(now) - dur(12 hours))
sort file.mtime desc

If there are no errors with your code, your note should look something similar to this:

Use headers so that you have the ability to narrow down in Canvas.

Together with my existing tag queries, these two Dataview queries make for some impressive looking widgets once moved onto the Canvas.

Current dashboard, featuring the widgets created above!

I hope you're enjoying this "unofficial" Canvas series. The next article will feature how to incorporate random quotes into it. With my current highlighting workflow in tandem with Readwise Reader, I have some ideas! ⚡

Discussion