---
title: Per-app layers
description: Bindings that only fire while a given app is frontmost.
---

Some bindings only make sense in one app. You can scope a whole layer to it, or a
single binding.

## In karabiner.ts

```ts layers/app-rules.ts
withCondition(ifApp(apps.chrome.bundleId))([
  // …mappings that only apply in Chrome
])
```

## A layer for one app

In the sidebar, **+** → **App** makes a group whose bindings only fire in that
app. Groups nested under it inherit the condition: here Reading, under Chrome,
only applies in Chrome.

Modes don't inherit it. A mode's keys work wherever it was entered, so scope the
binding that enters it instead. In [Get started](/docs/start#vim-keys-in-chrome),
<kbd>f</kbd> in the Chrome group enters Nav, so Nav can only start in Chrome.

![The Nav layer, entered with F in Chrome](/blume-assets/content/assets/screenshots/layer-list.png)

## One binding for one app

A binding's **Only when** takes the same App condition. In the Leader mode,
<kbd>a</kbd> sends ⌘L only while Chrome is frontmost, and does nothing elsewhere.

An App condition can list several apps, as `ifApp([...])` does, and matches any
of them.
