Bases Filter Switches turns saved filters on and off with one click

A row of switches under the base toolbar, each one a saved filter you turn on or off with a click.

MIT · no telemetry · core features free

A Tasks base with a Status group of switches under the toolbar, where Todo and Doing are on and the table shows 7 results.
Open larger
version
1.0.1
released
downloads
2
review
Passed
health
Excellent
license
MIT
platforms
Desktop, Mobile
obsidian
1.13.4 or later

Tested on desktop with Obsidian 1.13.4 and 1.14.4.

Directory facts fetched from community.obsidian.md/users/theluckystrike.

About Bases Filter Switches

You have one base with many filter combinations and don't want to keep one view for every mix.

Each switch is a saved filter, such as Todo for status == "todo". Click it and the base shows only those notes. Click it again and the filter is gone. You never open the filter editor.

The switches work in base files and in bases embedded in notes. They also work with every layout, the table, cards, list and the layouts of other plugins. That's because a switch changes the filter of the base itself.

Clicking Todo, then Doing, then All, then Done above a base of tasks; the rows change after each clickPlay demo

Free features

Switches above a base

Switches of one group are joined with "or", so Todo and Doing together show the notes that are todo or doing. Different groups are joined with "and", and the All switch turns a whole group off. Each switch that is on is a real top-level filter of the base, and your own filters are never changed.

A base of tasks with the Todo and Doing switches on, showing 7 results.
Open larger

Embedded bases

A base embedded in a note gets the same switches under its toolbar, in live preview and in reading view. A switch changes the base file, so every note that embeds this base shows the same filter.

A note with an embedded base and the Done switch on, showing 3 notes.
Open larger

Add a switch without writing YAML

Select the + button, then type a group, a label and a filter in the same syntax as the filter editor. You can also pick a filter the base already has, and it becomes a switch. Right-click a switch to edit or remove it.

The Add a filter switch window with fields for the group, the label and the filter.
Open larger

Theme colors and keyboard

The switches take their colors from your theme, in light and dark mode, and a switch that is on has the accent color. Press Tab to reach the row, the arrow keys to move, and Enter or Space to flip a switch.

The switch row in the light theme with the Doing switch on.
Open larger

The free version gives each base one group of up to 3 switches, and the row says how many more the file holds.

Pro features

Pro costs $5 a month or $15 one time through GitHub Sponsors. One sponsorship turns on Pro in all 15 plugins.

Switches from the values of a property Pro

Run "Add switches from the values of a property" and choose a property such as area. The group gets one switch for each value that notes have now, and new values show up by themselves. You can make the group "one at a time", so a click on one switch turns the others off.

An Area group with one switch for each value of the area property, which are home, learning and work.
Open larger

Presets Pro

A preset saves which switches are on, in every group, under one name. Choose it from the Presets menu to set all groups at once. Each preset also gets a command, so you can give it a hotkey.

A preset applied to the Tasks base, with the Todo, Doing and work switches on and 4 results in the table.
Open larger

Set up Bases Filter Switches

needs

  • Obsidian 1.13.4 or later
  • The core plugin Bases, turned on
  • Base code blocks inside a note don't get switches, because the plugin edits base files only. Embed a base file in the note instead.

steps

  1. Open a base and find the small "+ Filter switch" button under the toolbar.

  2. Select it and add a switch, for example group Status, label Todo and filter status == "todo".

  3. Add more switches to the group, then click them to filter the base.

  4. Select All to show every note again, or run "Turn every filter switch off in the current base".

  5. If you prefer YAML, edit the filterSwitches key in the base file by hand.

Why this exists

Two forum requests about quick filter toggles in Bases have 41 votes together, 36 on topic 101040 and 5 on topic 101311.

How to turn filters on and off in Obsidian Bases

How it compares

Bases Toolbox
Bases Toolbox has a command that turns single top-level filter conditions off and on from a window. Bases Filter Switches puts the switches on the base itself, supports groups with "or" between switches, and works in embedded bases.

Questions about Bases Filter Switches

Where does Bases Filter Switches save which filters are on?

In the filters of the base file. A switch is on when its filter is in the top-level filters. If you type a filter by hand that is the same as a switch, that switch shows as on.

Can a switch filter only one view of a base?

No. Switches change the top-level filters, so they apply to every view of the base. View filters stay as they are.

Does it rewrite the rest of my base file?

It edits only the top-level filters and its own filterSwitches key, and it keeps your comments, key order and quotes. Core Bases rewrites the whole file when you change a view in the app, and then the comments are lost. That's how core saves, not this plugin.

Network use

Bases Filter Switches makes no network requests until you select "Sign in with GitHub" in the settings. Sign in uses the GitHub device flow with the scope read:user, which gives no access to repositories and no write access. After that, the plugin checks your sponsorship at most once every 7 days or on Refresh, and it sends no vault data.

Read the full network disclosure

Bases Filter Switches 1.0.1, MIT license

MIT · no telemetry · core features free