> For the complete documentation index, see [llms.txt](https://walksy.gitbook.io/walksylib-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://walksy.gitbook.io/walksylib-docs/using/categories-and-groups.md).

# Categories and Groups

Configs are organised in two levels:

* **Categories** are the tabs of your config screen.
* **Groups** are sections inside a category.

## Categories

```java
Category.builder("General")
    .group(...)
    .option(...)
    .build()
```

A category can hold groups, loose options, or both. Loose options are shown above the groups.

## Groups

```java
OptionGroup.builder("Appearance")
    .option(Options.ofBoolean("Grayscale Texture", () -> grayscale, false, value -> grayscale = value).build())
    .option(Options.ofColor("Tint", () -> tint, DEFAULT_TINT, value -> tint = value).build())
    .expanded(false)
    .build()
```

## Putting it together

```java
Config.builder()
    .path(PathUtils.ofConfigDir("mymod"))
    .category(Category.builder("General")
        .group(OptionGroup.builder("General")
            .option(...)
            .build())
        .group(OptionGroup.builder("Appearance")
            .option(...)
            .build())
        .build())
    .category(Category.builder("Advanced")
        .option(...)
        .build())
    .build();
```

{% hint style="warning" %}
Values are saved by category, group and option name. Renaming a category or group moves where the values are stored, so users lose those settings.
{% endhint %}
