Skip to content

Bases

Bases let you treat your notes as a database. Define a base that pulls notes from a folder, tag, or search query, then view and filter them by their YAML frontmatter properties. Think of it like a spreadsheet view over your Markdown files.

Create a .base file from the sidebar or command palette. A base file is JSON that defines:

  • Source — Where to pull notes from (folder, tag, or search query)
  • Properties — Which frontmatter fields to display
  • Views — How to display the data (table, list, gallery)
  • Filters and sorts — How to narrow and order the results
{
"name": "Project Notes",
"source": {
"type": "folder",
"path": "/projects",
"recursive": true
},
"properties": {
"title": { "type": "text", "name": "Title" },
"status": { "type": "select", "name": "Status", "options": ["draft", "review", "published"] },
"tags": { "type": "multi-select", "name": "Tags" },
"created": { "type": "date", "name": "Created" },
"modified": { "type": "date", "name": "Modified" }
},
"views": {
"default": {
"type": "table",
"name": "All Notes",
"sort": [{ "property": "modified", "direction": "desc" }],
"display": {
"columns": [
{ "property": "title", "width": 200, "visible": true },
{ "property": "status", "width": 120, "visible": true },
{ "property": "tags", "width": 150, "visible": true },
{ "property": "modified", "width": 120, "visible": true }
],
"pageSize": 50
}
}
}
}

Each base has a source that determines which notes it includes:

Source typeConfigDescription
folderpath, recursiveAll Markdown files in a folder (optionally including subfolders)
tagtagAll notes with a specific tag in frontmatter
searchqueryNotes matching a text search query
manualManually selected notes

Properties map to YAML frontmatter fields. Lokus auto-detects types from values, but you can also define them explicitly.

TypeDescriptionExample value
textPlain text string"Meeting notes"
numberNumeric value42
dateDate or datetime2025-01-15
booleanTrue/falsetrue
selectSingle choice from options"draft"
multi-selectMultiple choices["react", "typescript"]
fileFile path reference"/path/to/note.md"
urlURL"https://example.com"
emailEmail address"user@example.com"
phonePhone number"+1-555-0123"
ratingNumeric rating (0-5)4
formulaComputed valueconcat(title, " - ", status)
relationLink to another base
rollupAggregation over a relation

The frontmatter in your Markdown files provides the data:

---
title: Weekly Review
status: draft
tags: [planning, weekly]
priority: high
due: 2025-02-28
---

The default view. Shows notes as rows and properties as columns. Features:

  • Click column headers to sort ascending/descending
  • Drag column borders to resize
  • Show/hide columns via the column manager
  • Pagination (configurable page size, default 50)
  • Click a row to open that note

A compact vertical list showing note names and selected properties. Good for scanning through many notes quickly.

A grid of cards, each showing a note’s properties in a card layout. Useful when notes have images or you want a more visual overview.

Click the filter icon to open the filter builder. Each filter has three parts:

  1. Property — Which field to filter on
  2. Operator — How to compare
  3. Value — What to compare against
CategoryOperators
Equality==, !=
Comparison>, >=, <, <=
Textcontains, not-contains, starts-with, ends-with, matches
Arrayin, not-in
Existenceis-empty, is-not-empty
TagstaggedWith, not-taggedWith
FilesinFolder, not-inFolder, hasOutlink, hasBacklink
Datesbefore, after, on, between

Combine multiple filters with AND or OR logic.

These functions work in filter expressions:

FunctionDescription
taggedWith(file, tag)File has a specific tag
inFolder(file, path)File is in a folder
hasLink(file, target)File links to target
hasProperty(file, prop)File has a frontmatter property
isEmpty(file)File content is empty
hasContent(file, text)File contains specific text
wordCount(file)Word count of file
createdAfter(file, date)Created after a date
createdBefore(file, date)Created before a date
modifiedAfter(file, date)Modified after a date

Sort by any property in ascending or descending order. You can apply multiple sort levels — the first sort is primary, subsequent sorts break ties.

"sort": [
{ "property": "priority", "direction": "desc" },
{ "property": "modified", "direction": "desc" }
]

Type-aware sorting is built in: numbers sort numerically, dates sort chronologically, booleans sort by value, and text sorts alphabetically using locale-aware comparison.

Define computed properties using formula expressions. The formula engine supports:

sum, average, min, max, count, round, ceil, floor, abs, sqrt, power

concat, length, upper, lower, trim, substring, replace, split, join

now, today, year, month, day, weekday, dateAdd, dateDiff, formatDate

if, and, or, not, switch

noteTitle, notePath, noteTags, noteCreated, noteModified, backlinks, outlinks

"daysSinceModified": {
"type": "formula",
"name": "Days Since Modified",
"formula": "dateDiff(noteModified(), now(), 'days')"
}

By default, a base queries all files matching its source. You can narrow the scope to the currently selected folder in the file tree by toggling the scope mode between “all” and “current folder” in the bases toolbar.

Click the export button to download the current view as a CSV file. The export includes all visible rows and columns, with arrays joined by semicolons and dates formatted as ISO strings.

Each base has configurable settings:

SettingDefaultDescription
defaultView"default"Which view to show when opening the base
allowCreatetrueAllow creating new notes from the base
allowEdittrueAllow editing note properties inline
allowDeletefalseAllow deleting notes from the base
templateTemplate to use when creating new notes
autoRefreshfalseAuto-refresh data on an interval
refreshInterval30000Refresh interval in milliseconds