Api Reference

obsidian-bases

Implements structured data views from YAML definitions.
Properties3
Is BaseNo
Iconi-lucide-database
Order2

The obsidian-bases module enables specialized data views (Tables, Lists, Cards) leveraging parsed metadata from your vault. It supports complex filtering, formula calculation, and aggregations.

File Format

Base files use the .base extension and contain valid YAML.

filters:
  and:
    - file.hasTag("project")
    - 'status == "active"'

formulas:
  days_remaining: '(date(due) - today()) / 86400000'

views:
  - type: table
    name: "Active Projects"
    order:
      - file.name
      - status
      - formula.days_remaining

Filter Syntax

Filters narrow down results using text expressions and logical operators.

Structure

# Simple
filters: 'status == "done"'

# Logical AND
filters:
  and:
    - 'priority > 1'
    - 'file.hasTag("urgent")'

# Logical OR
filters:
  or:
    - 'category == "A"'
    - 'category == "B"'

Properties

You can filter on:

  • File Metadata: file.name, file.mtime, file.size, file.tags, file.folder
  • Frontmatter: status, author, priority (any key in your markdown frontmatter)
  • Computed Formulas: formula.my_calc

Formulas

Formulas allow you to compute new values.

formulas:
  # Arithmetic
  total: "price * quantity"
  
  # Conditionals
  status_icon: 'if(done, "✅", "⏳")'
  
  # Date Math
  days_old: '(now() - file.ctime) / 86400000'

View Types

  1. Table: Standard row/column layout.
  2. Cards: Grid layout, great for items with images (cover property).
  3. List: Simple list of items.
  4. Map: Geographic map (requires lat/lng properties).

Component Usage

The module exposes the ::obsidian-base MDC component for rendering frames.

Full Syntax

Pass structured configuration via individual props:

::obsidian-base{source="Projects" views='[{"type":"table"}]'}
::

Shorthand Syntax

For inline use in markdown pages, a simplified syntax is available:

::obsidian-base
---
folder: /Blog
layout: list
sort: date
direction: desc
limit: 10
---
::
PropTypeDescription
folderstringFolder to query (creates a file.inFolder() filter)
layoutstringView type: table, cards, or list
sortstringProperty to sort by (prefix with - for descending)
directionstringSort direction: asc or desc
limitnumberMaximum number of results

The shorthand props are translated into the full BaseConfig structure internally.

Standalone .base files use the full YAML format and are automatically converted into this component by the obsidian-bases module.