Docs
Dashboard

Attributes and attribute values

Last updated View as Markdown

Attributes and attribute values

Attributes make choices such as color, size, and material consistent across a catalog. They are useful when buyers select an option or filter products by a structured value.

Definitions, assignments, and selections

An attribute defines a dimension. Its attribute values define the allowed choices. A product assignment determines which choices apply to that product. A variant selects values from those assignments.

For a shirt in two colors and three sizes, the product can have Color and Size assignments. Create a variant for each combination you actually sell. A storefront must not offer every theoretical combination unless a returned variant represents it.

Choose attributes for choices

Use attributes for reusable options and discovery. Use categories for navigation, collections for curated groups, and metafields for typed data such as a care instruction or technical specification. A tag is useful for a lightweight label that does not need an option definition.

Changing an option safely

Create definitions and allowed values before assigning them to products and variants. Preserve IDs when changing display names. Before removing a value, check the products and variants that use it and update their selections deliberately. Reordering options should change their presentation, not their identity.

To expose an attribute as a filter, configure a facet. Use its returned queryField in the storefront instead of deriving a search field from the attribute’s display name.

See attributeCreate and AttributeAssignmentInput for the exact contracts.