> For the complete documentation index, see [llms.txt](https://docs.quickclient.cc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.quickclient.cc/en/settings/types.md).

# Kinds of settings

Checkboxes, sliders, lists and other settings that Quick shows in the menu.

Settings let you change how a script behaves from the menu. You declare them as class fields using the `Script` factories. In the menu they appear under the script row in the order you created them. You do not need to save them yourself: Quick remembers the values and restores them on load. The key is `id()`.

```java
private final CheckBox enabled = checkBox("Enabled", true);
private final Slider delay = slider(enabled, "Delay", 200f, 0f, 1000f, 50f).postfix("ms");
private final Selectable mode = selectable("Mode", "Fast", "Fast", "Smooth");
private final ColorPicker color = colorPicker("Color", 0xFF5AC8FF);

@Override
public void onTick() {
    if (enabled.value() && mode.is("Fast")) chat(delay.intValue() + " ms");
}
```

## How it works

* The `delay` slider is nested inside the `enabled` checkbox, so the menu shows it only while the checkbox is on.
* The second argument of `selectable` sets the default option, followed by the list of all options.
* In `onTick()` the values are read straight from the fields, without going through a config.

## Creating

| Method                                   | Type          | Description                                                                                   |
| ---------------------------------------- | ------------- | --------------------------------------------------------------------------------------------- |
| `checkBox(name, value)`                  | `CheckBox`    | checkbox                                                                                      |
| `slider(name, value, min, max, step)`    | `Slider`      | slider with a number                                                                          |
| `selectable(name, selected, options...)` | `Selectable`  | one option from a list                                                                        |
| `combo(name, options, preselected...)`   | `Combo`       | several options from a list; `options` is passed as an array                                  |
| `colorPicker(name, argb)`                | `ColorPicker` | color `0xAARRGGBB`                                                                            |
| `input(name, value, placeholder)`        | `Input`       | text field                                                                                    |
| `button(name, action)`                   | `Button`      | button                                                                                        |
| `hotkey(name, key, action)`              | `Hotkey`      | key with an action; `key` is a GLFW code or `Hotkey.UNKNOWN`                                  |
| `custom(name, height)`                   | `Custom`      | a strip the script draws itself, see [Entries with their own drawing](/en/settings/custom.md) |

Every factory has a variant that takes `parent` as the first argument. This is the checkbox the setting is placed inside: `slider(enabled, "Delay", …)`. A nested setting is visible while its parent checkbox is on. Only a `CheckBox` can be a parent.

You cannot create two settings with the same name under the same parent. Doing so throws `IllegalArgumentException`.

## Common methods

| Method                   | Type       | Description                                                                      |
| ------------------------ | ---------- | -------------------------------------------------------------------------------- |
| `name()`                 | `String`   | name in the menu                                                                 |
| `id()`                   | `String`   | key in the config; taken from the name by default                                |
| `id(stableId)`           | `S`        | your own key, so you can rename the setting without losing its value             |
| `description()`          | `String`   | hint under the setting                                                           |
| `description(value)`     | `S`        | set the hint                                                                     |
| `parent()`               | `CheckBox` | parent checkbox or `null`                                                        |
| `visible()`              | `boolean`  | whether the setting is visible now, taking the parent and condition into account |
| `visibleWhen(condition)` | `S`        | show only while the condition holds                                              |

`S` is the type of the setting itself, so calls can be chained: `slider(...).postfix("ms").id("delay").description("…")`.

## Checkbox

| Method               | Type       | Description                |
| -------------------- | ---------- | -------------------------- |
| `value()`            | `boolean`  | whether the checkbox is on |
| `value(next)`        | `CheckBox` | turn on or off             |
| `toggle()`           | `CheckBox` | toggle                     |
| `onChange(consumer)` | `CheckBox` | called on every change     |

## Slider

| Method               | Type     | Description                                |
| -------------------- | -------- | ------------------------------------------ |
| `value()`            | `float`  | value, always within `min..max`            |
| `intValue()`         | `int`    | value rounded to an integer                |
| `value(next)`        | `Slider` | set; a value outside the bounds is clamped |
| `min()`, `max()`     | `float`  | bounds                                     |
| `step()`             | `float`  | step when dragging the slider in the menu  |
| `postfix()`          | `String` | unit after the number                      |
| `postfix(unit)`      | `Slider` | set the unit: `"ms"`, `"%"`, `"t"`         |
| `onChange(consumer)` | `Slider` | called on every change                     |

The step applies only in the menu. `value(next)` does not round the value.

## Text and color

| Method                | Type          | Description                         |
| --------------------- | ------------- | ----------------------------------- |
| `input.value()`       | `String`      | text                                |
| `input.value(next)`   | `Input`       | set; `null` becomes an empty string |
| `input.placeholder()` | `String`      | hint shown while the field is empty |
| `input.empty()`       | `boolean`     | whether the field is empty          |
| `input.onChange(c)`   | `Input`       | called on every change              |
| `color.value()`       | `int`         | color `0xAARRGGBB`                  |
| `color.value(argb)`   | `ColorPicker` | set the color                       |
| `color.onChange(c)`   | `ColorPicker` | called on every change              |

## Selection

| Method                   | Type           | Description                                |
| ------------------------ | -------------- | ------------------------------------------ |
| `selectable.value()`     | `String`       | selected option                            |
| `selectable.value(next)` | `Selectable`   | select by name; an unknown name is ignored |
| `selectable.is(option)`  | `boolean`      | whether this option is selected            |
| `selectable.options()`   | `List<String>` | all options                                |
| `selectable.onChange(c)` | `Selectable`   | called on every change                     |
| `combo.value()`          | `List<String>` | selected options in declaration order      |
| `combo.has(option)`      | `boolean`      | whether this option is selected            |
| `combo.set(option, on)`  | `Combo`        | select or deselect an option               |
| `combo.options()`        | `List<String>` | all options                                |
| `combo.onChange(c)`      | `Combo`        | called on every change                     |

## Key and button

| Method             | Type      | Description                               |
| ------------------ | --------- | ----------------------------------------- |
| `hotkey.key()`     | `int`     | GLFW code or `Hotkey.UNKNOWN`             |
| `hotkey.key(code)` | `Hotkey`  | assign a different key                    |
| `hotkey.bound()`   | `boolean` | whether a key is assigned                 |
| `button.press()`   | `void`    | run the action; exceptions are suppressed |

A hotkey fires on press while the script is enabled, and Quick calls its action for you. Key codes are the same as in `Keys`, see the list in [Keys and binds](/en/actions/keys.md). A button has no value and no listener, only an action.

## From chat

`.script settings <name>` lists all settings of a script with their ids and values, and `.script set <name> <id> <value>` changes one of them. Write the value the same way `settings` shows it: `true`/`false`, a number, an option name, and for combo the options separated by commas.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.quickclient.cc/en/settings/types.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
