> ## Documentation Index
> Fetch the complete documentation index at: https://docs.assistantscenter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Theme Options

A [Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) for the home page which is called to fetch data for the cards and graph.

## Example Usage

```js theme={null}
theme: SoftUI({
  customThemeOptions: {
    index: async ({ req, res, config }) => {
      const cards = [
        {
          title: "CPU",
          icon: "single-02",
          getValue: "Title",
          progressBar: {
            enabled: false,
            getProgress: 50, // 0 - 100 (get a percentage of the progress)
          },
        },
        // Include 3 more cards
      ];

      const graph = {
        values: [690, 524, 345, 645, 478, 592, 468, 783, 459, 230, 621, 345],
        labels: ["1m", "2m", "3m", "4m", "5m", "6m", "7m", "8m", "9m", "10m"],
      };

      return {
        cards,
        graph,
      };
    },
  },
});
```

## Image

<Frame>
  <img src="https://mintcdn.com/assistantscenter/e0fzjuWUPc5-sSJC/images/content/cto.jpg?fit=max&auto=format&n=e0fzjuWUPc5-sSJC&q=85&s=b14e4a638aa3372eb9a19ca53edabeca" width="2054" height="815" data-path="images/content/cto.jpg" />
</Frame>

## Props

### Cards

An Array of addon IDs which will be imported into the theme.

```js theme={null}
theme: SoftUI({
  customThemeOptions: {
    index: async ({ req, res, config }) => {
      const cards = [
        {
          title: String,
          icon: String,
          getValue: String,
          progressBar: {
            enabled: Boolean,
            getProgress: Number,
          },
        },
      ];

      return {
        cards,
      };
    },
  },
});
```

#### Example Usage

```js theme={null}
theme: SoftUI({
    customThemeOptions: {
        index: async ({ req, res, config }) => {
            let username = req.session?.user?.username || "Guest";
            let avatar = req.session?.user?.avatar ? `https://cdn.discordapp.com/avatars/${req.session.user.id}/${req.session.user.avatar}.png` : 'https://cdn.discordapp.com/embed/avatars/0.png';

            const cards = [
                {
                    title: "CPU",
                    icon: "single-02",
                    getValue: os.cpus()[0].model.replace('(R) Core(TM) ', ' ').replace(' CPU ', '').split('@')[0],
                    progressBar: {
                        enabled: false,
                        getProgress: 50
                    }
                },
                {
                    title: "System Platform",
                    icon: "single-02",
                    getValue: os.platform(),
                    progressBar: {
                        enabled: false,
                        getProgress: 50
                    }
                },
                {
                    title: "Server count",
                    icon: "single-02",
                    getValue: `${client.guilds.cache.size} out of 75`,
                    progressBar: {
                        enabled: true,
                        getProgress: (client.guilds.cache.size / 75) * 100
                    }
                },
                {
                    title: "Current User",
                    icon: avatar, // Use the avatar URL here
                    getValue: username,
                    progressBar: {
                        enabled: false,
                        getProgress: client.guilds.cache.size // Placeholder value
                    }
                },
            ]

            return {
                cards
            }
        }
    }
})
```

### Image

<Frame>
  <img src="https://mintcdn.com/assistantscenter/e0fzjuWUPc5-sSJC/images/content/cards.jpg?fit=max&auto=format&n=e0fzjuWUPc5-sSJC&q=85&s=aa3404290bcdbab2ae67e6a67b7e2fb4" width="1558" height="174" data-path="images/content/cards.jpg" />
</Frame>

### Graph

An Array of addon IDs which will be imported into the theme.

```js theme={null}
theme: SoftUI({
  customThemeOptions: {
    index: async ({ req, res, config }) => {
      const graph = {
        values: Number[],
        labels: String[],
      };

      return {
        graph,
      };
    },
  },
});
```

#### Example Usage

```js theme={null}
theme: SoftUI({
  customThemeOptions: {
    index: async ({ req, res, config }) => {
      const graph = {
        values: [690, 524, 345, 645, 478, 592, 468, 783, 459, 230, 621, 345],
        labels: ["1m", "2m", "3m", "4m", "5m", "6m", "7m", "8m", "9m", "10m"],
      };

      return {
        graph,
      };
    },
  },
});
```

<Tip>**Edit graph info [here](/soft-ui/docs/index)**</Tip>

### Image

<Frame>
  <img src="https://mintcdn.com/assistantscenter/e0fzjuWUPc5-sSJC/images/content/graph.jpg?fit=max&auto=format&n=e0fzjuWUPc5-sSJC&q=85&s=264f9476f83b90519eb12d7e712fa929" width="2036" height="770" data-path="images/content/graph.jpg" />
</Frame>
