Skip to content
On this page

Custom Theme Options

A Function for the home page which is called to fetch data for the cards and graph.

Example Usage

js
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
            }
        }
    }
})

Tip!

?> Maximum 4 cards
The maximum number of cards to be returned is 4.

Properties

Types

Released under the MIT License.