Category
A category is used to group together items of the same kind (e.g., all CPU-related metrics).
Every Metric and every Action belongs to exactly one category.
See also: Registering Items
Properties
| Property | Type | Restrictions | Description |
|---|---|---|---|
Id | string | Required Length: 1 - 256Pattern: ^[\w\.\-]+$ | The unique identifier of the category. |
Label | string | Required Length: 1 - 64 | The textual label of the category. Longer labels are truncated. |
Description | string? | Max length: 256 | An optional textual description of the category. |
Icon | string? | Length: 1 - 256Pattern: ^[\w\.\-]+$ | An optional icon (the ID of a registered Icon). |
SubCategories | IEnumerable<Category>? | Max. 10 subcategories | An optional list of subcategories. |
Core Categories
Commonly used categories are provided by the SDK as CoreCategory and are automatically registered by MoBro.
Core categories come with predefined labels, descriptions and translations for all languages currently supported by
MoBro. They can't be overwritten by a custom category with the same ID.
tip
Prefer core categories over custom categories wherever applicable. This ensures consistent categorization of metrics across all plugins.
| Category | Description |
|---|---|
Miscellaneous | For items that do not fit into any specific category. |
Battery | Battery-related items (e.g., capacity). |
Cpu | CPU (processor)-related items (e.g., load, temperature). |
Gpu | GPU (graphics card)-related items (e.g., load, temperature). |
Mainboard | Mainboard-related items (e.g., voltage, temperature). |
Network | Network-related items (e.g., NICs, download speed). |
Ram | RAM (memory)-related items (e.g., usage, available memory). |
Storage | Storage-related items (e.g., SSDs, HDDs). |
System | System-related items (e.g., operating system, user). |
Fan | Fan-related items (e.g., fan speed). |
Weather | Weather-related items (e.g., current temperature, weather icon). |
Media | Media-related items (e.g., currently playing media, controls, volume). |
Program | Items related to a specific program. |
Game | Items related to a specific game. |
Custom Categories
Custom categories are created using the MoBroItem.CreateCategory() builder and must be registered before any item
references them:
var financeCategory = MoBroItem
.CreateCategory()
.WithId("finance")
.WithLabel("Finances", "Everything related to money")
.WithSubCategory(sub => sub
.WithId("finance_crypto")
.WithLabel("Crypto")
.Build())
.Build();
_mobro.Register(financeCategory);