# Quick Tiles Configuration

# Quick Tiles Configuration

**File:** `quickaccess/quickaccess.json`

Since 3.0.0 the quick-access buttons are the **tiles** of the Info Hub book. The Start tab shows the first eight ("show all" opens every tile); the book order is the left group first, then the right group. The file format of the old sidebars stays, so existing files keep working. The **Tiles** board of the [admin window](./admin-panel#content-boards) edits this file.

:::caution Security (2.10.8)
The client never receives a tile's command. A click only sends a tile reference; the server looks the tile up in the current file, checks its permission again and only then runs the command. Update from versions before 2.10.8.
:::

## Complete Example

```json
{
  "left": {
    "enabled": true,
    "width": 260,
    "title": "Navigation",
    "categories": [
      {
        "title": "Links",
        "icon": "Ore_Prisma",
        "color": "#4a9eff",
        "buttons": [
          {
            "label": "Discord",
            "command": "https://discord.gg/example",
            "text": "Join our Discord Server!"
          },
          {
            "label": "Website",
            "command": "https://example.com"
          }
        ]
      },
      {
        "title": "Teleports",
        "icon": "Weapon_Longsword_Iron",
        "color": "#69db7c",
        "buttons": [
          { "label": "Home", "command": "/home" },
          { "label": "Spawn", "command": "/spawn" }
        ]
      }
    ]
  },
  "right": {
    "enabled": true,
    "width": 260,
    "title": "Quick Access",
    "categories": [
      {
        "title": "Achievements",
        "icon": "Ore_Gold",
        "buttons": [
          { "label": "Achievements", "command": "/ksachievements" },
          { "label": "Rewards", "command": "/ksrewards" }
        ]
      },
      {
        "title": "Tools",
        "icon": "Tool_Pickaxe_Iron",
        "buttons": [
          { "label": "Settings", "command": "/settings" },
          { "label": "Statistics", "command": "/stats" }
        ]
      }
    ]
  }
}
```

---

## Group Structure (left / right)

```json
{
  "enabled": true,
  "width": 260,
  "title": "Sidebar Title",
  "categories": []
}
```

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `enabled` | Boolean | `true` | Enable/disable the tiles of this group |
| `width` | Integer | `260` | No longer used since 3.0.0 (kept readable) |
| `title` | String | `"Quick Access"` | Group title |
| `categories` | Array | `[]` | Categories with buttons |

---

## Category Structure

```json
{
  "title": "Category Title",
  "icon": "Item_Id",
  "color": "#4a9eff",
  "textColor": "#4a9eff",
  "buttons": []
}
```

| Field | Type | Default | Description |
|-------|------|---------|-------------|
| `title` | String | - | Category heading |
| `icon` | String | - | Item ID for icon |
| `color` | String | auto | Accent color for header background and indicator bars (`#RRGGBB` or `#RRGGBBAA`) |
| `textColor` | String | same as `color` | Text color for category header title (`#RRGGBB`) |
| `buttons` | Array | `[]` | Buttons in this category |
| `i18n` | Object | - | Optional title per language |

:::tip Auto Colors
If no `color` is set, a color is automatically assigned from a built-in palette. The `textColor` defaults to the accent `color` if not explicitly set.
:::

---

## Button Structure

Each button in the Quick Access sidebar can have the following properties:

```json
{
  "label": "Button Text",
  "command": "/command",
  "text": "Optional custom text",
  "permission": "some.permission",
  "runAsConsole": false,
  "icon": "Tool_Map"
}
```

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `label` | String | Yes | - | The text displayed on the button |
| `command` | String | Yes | - | The command to execute or URL to open |
| `text` | String | No | - | Optional text for chat links (only for URLs) |
| `permission` | String | No | `null` | Permission required to see this button (null = visible to all) |
| `runAsConsole` | Boolean | No | `false` | If `true`, the command runs as the server console instead of the player |
| `icon` | String | No | category icon | Tile icon (item id) |
| `i18n` | Object | No | - | Optional `label` / `text` per language |

:::caution Console tiles
A tile with `runAsConsole: true` runs with full server rights. Restrict it with `permission`. Adding, changing or removing such a tile needs `ks.info.admin` **and** `ks.core.admin.dialog.console`, in the admin window, on save and in web editor imports. Console tiles cannot use `{placeholders}`. See [Permissions](./permissions#quick-tiles-that-run-as-the-console).
:::

### Supported Actions

#### Commands
Commands start with `/` or are a simple command name. They run as the player (unless `runAsConsole` is set):

```json
{ "label": "Home", "command": "/home" }
{ "label": "Spawn", "command": "spawn" }
```

#### Links
URLs starting with `http://` or `https://` are displayed as clickable links in chat:

```json
{ "label": "Discord", "command": "https://discord.gg/example" }
```

#### Links with Custom Text
The optional `text` field overrides the automatically extracted domain name:

```json
{
  "label": "Discord",
  "command": "https://discord.gg/example",
  "text": "Join our Discord Server!"
}
```

:::tip URL Handling
When a button with a URL is clicked, the player receives a clickable chat message with the link. Without the `text` field, the domain name is shown. With the `text` field, your custom text is displayed instead.
:::

#### Jumps inside the book (3.0.0)

A command starting with `infohub:` opens a place in the book instead of running anything:

| Command | Opens |
|---------|-------|
| `infohub:rules`, `infohub:faq`, `infohub:commands`, `infohub:team`, `infohub:server`, `infohub:news` | That tab |
| `infohub:tiles` | All tiles |
| `infohub:search` / `infohub:search:<query>` | Search (with a query) |
| `infohub:page:<id>` | A custom page |
| `infohub:rule:<category>:<id>` | One rule |
| `infohub:faq:<id>` | One FAQ entry |
| `infohub:cmd:<name>` | One command in the Commands tab |

```json
{ "label": "Rules", "command": "infohub:rules", "icon": "Weapon_Sword_Iron" }
```

#### Tiles with values

A command with `{Placeholder}`s asks the player for the values in a small window inside the book, then runs the command **as the player**:

```json
{ "label": "Pay", "command": "/pay {Player} {Amount}" }
```

Typed values have control characters stripped and are length-capped.

---

## Limits

- Up to **10 rows of 4 tiles** per group (left and right). A category with more than 4 buttons continues in the next row.
- The admin window warns when a group goes beyond the limit; tiles beyond the tenth row are not shown.

---

## Examples

### Left Group Only

```json
{
  "left": {
    "enabled": true,
    "title": "Quick Menu",
    "categories": [
      {
        "title": "Navigation",
        "icon": "Tool_Map",
        "buttons": [
          { "label": "Spawn", "command": "/spawn" },
          { "label": "Home", "command": "/home" }
        ]
      }
    ]
  },
  "right": {
    "enabled": false,
    "title": "",
    "categories": []
  }
}
```

### Right Group Only

```json
{
  "left": {
    "enabled": false,
    "title": "",
    "categories": []
  },
  "right": {
    "enabled": true,
    "title": "Shortcuts",
    "categories": [
      {
        "title": "Shop",
        "icon": "Ore_Gold",
        "buttons": [
          { "label": "Shop", "command": "/shop" },
          { "label": "Sell", "command": "/sell" },
          { "label": "Balance", "command": "/balance" }
        ]
      }
    ]
  }
}
```

### No Tiles

```json
{
  "left": {
    "enabled": false,
    "title": "",
    "categories": []
  },
  "right": {
    "enabled": false,
    "title": "",
    "categories": []
  }
}
```

### Full Navigation Setup

```json
{
  "left": {
    "enabled": true,
    "title": "Navigation",
    "categories": [
      {
        "title": "Teleport",
        "icon": "Tool_Map",
        "buttons": [
          { "label": "Home", "command": "/home" },
          { "label": "Spawn", "command": "/spawn" },
          { "label": "Warps", "command": "/warps" },
          { "label": "TPA", "command": "/tpa" }
        ]
      },
      {
        "title": "Economy",
        "icon": "Ore_Gold",
        "buttons": [
          { "label": "Shop", "command": "/shop" },
          { "label": "Auction", "command": "/ah" },
          { "label": "Balance", "command": "/bal" }
        ]
      },
      {
        "title": "Social",
        "icon": "Deco_Inkwell",
        "buttons": [
          { "label": "Party", "command": "/party" },
          { "label": "Guild", "command": "/guild" },
          { "label": "Friends", "command": "/friends" }
        ]
      }
    ]
  },
  "right": {
    "enabled": true,
    "title": "Features",
    "categories": [
      {
        "title": "Progress",
        "icon": "Ore_Prisma",
        "buttons": [
          { "label": "Achievements", "command": "/ksachievements" },
          { "label": "Quests", "command": "/quests" },
          { "label": "Skills", "command": "/skills" },
          { "label": "Rewards", "command": "/ksrewards" }
        ]
      },
      {
        "title": "Info",
        "icon": "Deco_Book_Pile_Small",
        "buttons": [
          { "label": "Stats", "command": "/stats" },
          { "label": "Playtime", "command": "/playtime" },
          { "label": "Votes", "command": "/vote" }
        ]
      }
    ]
  }
}
```

---

## Best Practices

1. **Keep buttons relevant** - Most-used commands only
2. **Group logically** - Related commands together
3. **Use clear labels** - Short but descriptive
4. **Don't overcrowd** - Leave some space
5. **Test all buttons** - Ensure commands work