Skip to main content

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

PropertyTypeDescription
idstring (UUID)Unique identifier of the attribute.
namestringInternal name of the attribute.
labelstring | nullDisplay label for the front-end (if defined).
typestringData type of the attribute (e.g., string, number, date, boolean).
formatstring | nullSpecific formatting for the data type (e.g., date).
relevantbooleanIf true, the attribute is shown in the main specifications.
sortablebooleanIndicates if the catalog can be sorted by this attribute.
iconstring | nullReference to the associated icon (format library#icon).
positionnumberDisplay 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).