> 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/option-types.md).

# Option Types

Most options take the same four arguments: **name, getter, default, setter**.

## Boolean

```java
Options.ofBoolean("Enabled", () -> enabled, true, value -> enabled = value).build();
```

Extra: `.warning(Warning)`. See [Creating an Option](/walksylib-docs/using/creating-an-option.md#warnings-booleans-only).

## Number

```java
Options.ofNumber("Range", () -> range, 8, value -> range = value)
    .range(1, 32, 1)
    .build();

Options.ofNumber("Scale", () -> scale, 1.0f, value -> scale = value)
    .range(0.5f, 3.0f, 0.1f)
    .build();
```

`.range(min, max, increment)` sets the slider bounds and step.

## String

```java
Options.ofString("Prefix", () -> prefix, "[!]", value -> prefix = value).build();
```

## Enum

```java
Options.ofEnum("Mode", () -> mode, Mode.FADE, value -> mode = value, Mode.class).build();
```

## Color

Colors use `WLColor`, which supports alpha plus optional **rainbow** and **pulse** effects that users can toggle in the color picker.

```java
private static final WLColor DEFAULT_TINT = new WLColor(0, 255, 0, 255);
public static WLColor tint = DEFAULT_TINT.copy();

Options.ofColor("Tint", () -> tint, DEFAULT_TINT, value -> tint = value).build();
```

Use `.disableAlpha()` to hide the alpha slider.&#x20;

## Button

```java
Options.ofButton("Reset Stats", MyMod::resetStats).build();
```

## Texture

Users drag and drop an image onto the option.

```java
Options.ofTexture("Icon", () -> icon, DEFAULT_ICON, value -> icon = value).build();
```

### Cropped texture

Same as texture, but the user can crop the image to a fixed aspect ratio:

```java
Options.ofCroppedTexture("Banner Texture", () -> banner, CroppedTexture.NONE, value -> banner = value)
    .aspect(10f, 20f)
    .build();
```

Use `banner.texture()` for the `Identifier` and `u0/v0/u1/v1` for the crop. `CroppedTexture.NONE` means "no image".

## Pixel grid animation

An in-game pixel-art editor with animation frames.&#x20;

```java
Options.ofPixelGridAnimation("Crosshair", () -> crosshair, DEFAULT_CROSSHAIR, value -> crosshair = value).build();
```

Pixel grids have a built-in HUD renderer, so `.hudSpace("Crosshair")` works without a custom element. See [HUD Elements](/walksylib-docs/advanced/hud-elements.md).

## Item inventory

A full player inventory editor (hotbar, storage, armor, offhand).

```java
Options.ofInventory("Items", () -> kit, new ItemInventory(), value -> kit = value).build();
```

Add `.container()` to show only the 27 storage slots, like a chest or ender chest, instead of a full player inventory.

## Keybind

```java
Options.ofKeybind("Toggle", MyMod.TOGGLE_KEY).build();
```

See [Creating a Keybind](/walksylib-docs/keybinds/creating-a-keybind.md).

## Preview

A live, animated preview drawn at the top of your config. See [Previews](/walksylib-docs/advanced/previews.md).

```java
Options.ofPreview("Preview", MyModConfig::drawPreview).build();
```

## Lists and pages

String lists, selection lists, pages and page lists have their own page: [Lists & Pages](/walksylib-docs/using/lists-and-pages.md).

## Teams

`Options.ofTeams(...)` is a special page list with one page per team, where teams are shared by every WalksyLib mod. See [Teams](/walksylib-docs/advanced/teams.md).
