# Config editor

JSON config files edited in place: the first syntax error named by its line under the editor, Save held back until the file parses, the edits reviewed as a diff before they are saved, and a question before switching away from unsaved ones.

## Guidelines shown here

- [Forms](/ui/guidelines/patterns/forms/index.md)

  Break the JSON: the first error is named by its line under the editor, and Save waits until the file parses, while that line says why. Edit a file, then open another, and the unsaved edits are guarded.

- [Destructive actions](/ui/guidelines/patterns/destructive-actions/index.md)

  Review changes, then Discard changes: the edits go at once, and Undo in the toast brings them back. Only switching files over unsaved edits asks first.

- [Feedback](/ui/guidelines/patterns/feedback/index.md)

  Save a file for a toast that names it. A syntax error is said under the editor, where it can be fixed, and pressing it moves the caret to the error.

- [Overlays](/ui/guidelines/patterns/overlays/index.md)

  Review changes opens the diff in a Dialog, with the actions that answer it in its footer. Switching files over unsaved edits asks in UnsavedChangesDialog.

- [Navigation](/ui/guidelines/patterns/navigation/index.md)

  The files are a FileTree beside the open one, under a section headed by their folder. The Code view beside the demo lays out its own files the same way, a section for each folder they come from.

- [Desktop & pointer](/ui/guidelines/platforms/desktop-and-pointer/index.md)

  ⌘ or Ctrl and S saves the file, and the Save button carries the same keys in aria-keyshortcuts, so a screen reader announces them.

- [Touch & mobile](/ui/guidelines/platforms/touch-and-mobile/index.md)

  On a phone the file tree folds into a Select in the file's heading line, its rows at a thumb's size, and the error line under the editor grows to one too.

## Components

- [ui · FileTree](/ui/storybook/?path=/docs/ui-filetree--docs)
- [ui · Button](/ui/storybook/?path=/docs/ui-primitives-button--docs)
- [ui · Dialog](/ui/storybook/?path=/docs/ui-primitives-dialog--docs)
- [ui · NavList](/ui/storybook/?path=/docs/ui-primitives-navlist--docs)
- [ui · Pane](/ui/storybook/?path=/docs/ui-primitives-pane--docs)
- [ui · Select](/ui/storybook/?path=/docs/ui-primitives-select--docs)
- [ui · Toaster](/ui/storybook/?path=/docs/ui-primitives-toaster--docs)
- [ui · UnsavedChangesDialog](/ui/storybook/?path=/docs/ui-unsavedchangesdialog--docs)
- [ui-code · CodeDiffBlock](/ui/storybook/?path=/docs/ui-code-codediffblock--docs)
- [ui-codemirror · CodeEditor](/ui/storybook/?path=/docs/ui-codemirror-codeeditor--docs)
