Customize a storefront with Hydrogen
Previously, you created a custom storefront. You're now ready to start customizing your storefront with Hydrogen.
In this tutorial, you'll complete a series of tasks to add some specific functionality to your custom storefront. Your final custom storefront will be simple, but you’ll learn where to find resources to build more complex features on your own.
What you'll learn
Anchor link to section titled "What you'll learn"After you've finished this tutorial, you'll have accomplished the following:
- Customized text and component styles
- Fetched data from server components
- Made changes to GraphQL queries

Requirements
Anchor link to section titled "Requirements"You're using the most recent version of Hydrogen. The latest release gives you the benefits of performance enhancements, new components, and other best practices.
You've completed the create a custom storefront with Hydrogen tutorial.
Step 1: Make customizations
Anchor link to section titled "Step 1: Make customizations"Hydrogen provides a structure for building your app along with basic styles provided by Tailwind. You can customize any part of Hydrogen as long as you keep the following required files:
index.html
src/App.server.jsx
Change text
Anchor link to section titled "Change text"Make sure your development environment is running at http://localhost:3000.
In
src/components/Welcome.server.jsx
, change theHello, Hydrogen
text toHello, Snowboards
.Save the file to see your changes updated in real-time:

Change a component's style
Anchor link to section titled "Change a component's style"In
src/components/Welcome.server.jsx
, find the following code:Make the background color red for the
Hello, Snowboards
text:Save the file to see your changes updated in real-time:

Step 2: Fetch data from server components
Anchor link to section titled "Step 2: Fetch data from server components"Hydrogen offers the useShopQuery
and fetchSync
hooks to fetch data from server components. Most src/routes/*.server.jsx
components contain queries that you can modify.
useShopQuery
Anchor link to section titled "useShopQuery"To fetch data from your Shopify storefront, you can use the useShopQuery
hook. Your shop domain and token is automatically configured, so you only need to pass a GraphQL query
.
The useShopQuery
hook is designed to be used only in server components, because only server components can make calls to the Storefront API.
The fetchSync
hook makes API requests. It's designed similar to the Web API's fetch
, only in a way that supports Suspense.
Step 3: Make GraphQL changes
Anchor link to section titled "Step 3: Make GraphQL changes"You might want to make changes to a GraphQL query to fetch data for a specific need. For example, if you want to display a certain product attribute or shop attribute, then you can update a query.
In src/routes/index.server.jsx
, make a change to QUERY
at the bottom of the file. For example, fetch information about your shop:
The homepage renders the name of your shop:

Interactive GraphiQL interface
Anchor link to section titled "Interactive GraphiQL interface"You can explore the Storefront API and run test queries in your Hydrogen app. When you're running the Hydrogen local development server, you can visit the following URLs to load an interactive GraphiQL interface connected to your shop:
- Learn how to build product pages in Hydrogen.
- Explore the source code of the example Hydrogen demo store in GitHub.
- Get familiar with React Server Components.
- Learn more about the Shopify-specific commerce components, hooks, and utilities included in Hydrogen.