Attribute
Represents the base entity of your store's Attributes. Attributes are technical metadata or specific characteristics assigned to products or variants (e.g., Color, Material, Date, etc.).
Type Definition
| Property | Type | Description |
|---|---|---|
| id | string (UUID) | Unique identifier of the attribute. |
| name | string | Internal name of the attribute. |
| label | string | null | Display label for the front-end (if defined). |
| type | string | Data type of the attribute (e.g., string, number, date, boolean). |
| format | string | null | Specific formatting for the data type (e.g., date). |
| relevant | boolean | If true, the attribute is shown in the main specifications. |
| sortable | boolean | Indicates if the catalog can be sorted by this attribute. |
| icon | string | null | Reference to the associated icon (format library#icon). |
| position | number | Display order of the attribute. |
Object Example
{
"id": "3aac3a70-826d-48f2-809d-fc3992420829",
"name": "Data",
"label": "Release Date",
"type": "date",
"format": "date",
"relevant": true,
"sortable": true,
"icon": "react-icons/io5#IoCalendarNumber",
"position": 0
}
Usage in Interfaces
When iterating through attributes inside wr.shop.state.cache.attributes.items, you can use the type property to decide how to render the value (for example, formatting a date or showing a toggle for booleans).