# Theme variables

Source: https://support.storeconnect.com/articles/theme-variables · Last modified 21 August 2026

Variables are key-value pairs that you can use to provide configuration options for your theme.

You can add theme variables from the Related tab of your Theme.

Here we have a Key field. This must be unique per Theme. It can be anything you like, however it is good practice to use a naming convention, eg. group related items together using dot notation: `locations.search.default_distance`.

![Theme variables list on the Related tab of a Theme, showing existing key-value pairs](https://res.cloudinary.com/hzkr6fi81/image/upload/v1725790510/knowledge/themes/theme-variables_e3unvd.png)

![New theme variable form with a Key field for entering a unique variable name](https://res.cloudinary.com/hzkr6fi81/image/upload/v1725790516/knowledge/themes/new-variable_wpnprs.png)

## When to use Theme Variables

Theme variables are best used when you are creating a theme but want to give some configuration options that affect some aspect of the theme, so that the theme can be tweaked without having to alter the template code.

### Example

The example theme variable `locations.search.default_distance` is a real-world example of a variable from our built-in theme. It’s used in the Location Finder liquid template to set the default search radius for the location search.

We are aware that each Store that uses our built-in theme may want to have a different default distance for the search. So we provided a variable that can be used to change this distance.

## When Creating Themes

Theme authors will use variables when they are aware that the end-users of their themes may want to configure some aspect slightly differently. They should extract that value into a variable and provide a good default value for the variable.

## When Configuring Themes

Those who are using and configuring existing themes with variables can just adjust the value of the variable. If you are configuring one of the built-in themes, you will need to create a matching variable in your theme and set the value to whatever you need. This is how you override built-in theme variables.

## Using the theme variable in liquid code

Theme variables can be accessed using the global variable `theme_variables`.

### Example

Once again using our example variable, this is how you access its value:


```liquid

{{ theme_variables["locations.search.default_distance"] }}
```


Result:

```text

50
```

---

## Follow StoreConnect

- [Email Newsletter](https://getstoreconnect.com/c/lp-newsletter)
- [LinkedIn Newsletter](https://www.linkedin.com/build-relation/newsletter-follow?entityUrn=7444956928444862464)
- [YouTube](https://www.youtube.com/channel/UCngKdP2x8l1wcbAKW3tvU8g)
- [LinkedIn](https://www.linkedin.com/company/storeconnect)
- [X / Twitter](https://x.com/storeconnecthq)

## Popular Links

- [Partners](https://getstoreconnect.com/partners)
- [News](https://getstoreconnect.com/articles/news)
- [Events](https://getstoreconnect.com/articles/events)
- [Feature Comparison](https://getstoreconnect.com/how-we-compare)
- [Download a free trial](https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000FMkeKUAT)
- [Book a Demo](https://getstoreconnect.com/contact)

## Documentation

- [Help documentation](https://support.storeconnect.com/help-documentation)
- [AI agents](https://support.storeconnect.com/ai)
- [Videos & tutorials](https://support.storeconnect.com/videos-tutorials)
- [Developer reference](https://support.storeconnect.com/developer-reference)
- [Release notes](https://support.storeconnect.com/release-notes)
- [Troubleshooting](https://support.storeconnect.com/troubleshooting)
- [Trust Center](https://trust.getstoreconnect.com/)
- [Status Page](https://status.storeconnect.com/)

## Contact

- info@getstoreconnect.com
- US +1 415 745 3230
- AUS +61 2 8365 2308

100 S Ashley Dr, Suite 600-2461
Tampa FL 33602-600 USA

Level 22, Sydney Place
180 George Street
Sydney, NSW, 2000, AUS

---

StoreConnect Support — https://support.storeconnect.com/articles/theme-variables