Frequently Asked Questions

Features & Capabilities

What is the Simple Banner component in Hygraph, and what fields does it include?

The Simple Banner component in Hygraph is a reusable schema element designed to display a banner with a title, description, links, and theme selection. It includes fields for banner title (single line text), banner description (rich text), links (basic component field allowing multiple Link components), and a theme (enumeration field with options like 'light' and 'dark'). Note: The Simple Banner component is best suited for straightforward banner use cases; more advanced scenarios may require custom configurations or modular components.

What are enumerations in Hygraph, and how are they used in the Simple Banner recipe?

Enumerations in Hygraph are predefined sets of values that represent possible options for a field. In the Simple Banner recipe, the theme enumeration allows users to select between 'light' and 'dark' themes for their banners. Enumerations help standardize options and simplify content entry. Note: Enumerations are limited to static lists; dynamic or custom values require alternative schema approaches.

How do references work in Hygraph, and how are they used in the Simple Banner recipe?

References in Hygraph create relationships between content entries, enabling reuse and linking of internal content. In the Simple Banner recipe, references are used in the Link component to allow linking to internal models such as Author, Book, and Shop. Note: References are limited to models defined in your schema; cross-project references are not supported.

What is a component in Hygraph, and how does the Link component function in the Simple Banner recipe?

A component in Hygraph is a reusable set of fields that can be added to models and content entries. The Link component in the Simple Banner recipe includes fields for link label, external link (URL), internal link (reference to Author, Book, or Shop), and a boolean field for opening in a new tab. Note: The Link component is designed for basic linking; advanced link behaviors may require custom development.

What are nested components in Hygraph, and how are they used in banner recipes?

Nested components in Hygraph allow you to create component fields within a component, enabling parent-child relationships. In banner recipes, nested components can be used to build complex banners with multiple layers of content. Note: Deeply nested components may increase schema complexity and require careful planning.

Technical Requirements

What are the prerequisites for building a Simple Banner component in Hygraph?

To build a Simple Banner component in Hygraph, you need a Hygraph account and an active project. You can create a new project, clone a basic models project, clone the complete Banners cookbook, or use your existing project. Note: Plan limits may affect the number of components and entries you can create; review your plan details before starting.

How can I clone a project to use the Simple Banner recipe in Hygraph?

You can clone a project containing basic models (Author, Shop, Book) or the complete Banners cookbook directly from Hygraph. Use the provided links to clone the basic models project or the cookbook project. Note: Cloning projects is only available to users with appropriate permissions and plan limits.

What documentation is available for building banner components in Hygraph?

Hygraph provides extensive documentation, including guides for components, enumerations, references, and schema modeling. Key resources include the Components documentation, Getting Started guide, and API Reference. For banner-specific recipes, see the Simple Banner, Banner Slider, References Banner, and Image Banner guides. Note: Documentation is updated regularly; check for the latest versions.

Support & Implementation

How easy is it to implement the Simple Banner recipe in Hygraph?

Implementation of the Simple Banner recipe can be completed in minutes for basic use cases by cloning starter projects or following step-by-step guides. For more complex scenarios, Hygraph offers structured onboarding, extensive documentation, and community support via Slack. Note: Implementation time may increase with custom schema requirements or advanced banner configurations.

What support resources are available for Hygraph users building banner components?

Hygraph users can access support through documentation, community Slack channels, and onboarding tutorials. The Getting Started guide and Components documentation provide step-by-step instructions. For additional help, join the Hygraph community on Slack. Note: Direct support may be limited by plan type; enterprise customers receive enhanced support options.

Product Information

What models are used in the Simple Banner recipe, and what fields do they include?

The Simple Banner recipe uses three sample models: Author (fields: author name, bio, image), Book (fields: book name, description, cover image, author reference), and Shop (fields: shop name, address, picture, location). These models are referenced in the Link component for internal linking. Note: Models can be customized based on project requirements; the sample models are provided for demonstration purposes.

How does the Link component validate external URLs in Hygraph?

The Link component uses a Slug field for external links, with field validations set to match a URL pattern. If the input does not match the expected format, a custom error message is displayed. This ensures users enter valid URLs and reduces errors in content entry. Note: URL validation is limited to pattern matching; additional security checks may be required for production environments.

Security & Compliance

What security and compliance certifications does Hygraph hold?

Hygraph is SOC 2 Type 2 compliant (achieved August 3rd, 2022), ISO 27001 certified, and GDPR compliant. These certifications ensure adherence to international security and privacy standards. Note: Detailed limitations not publicly documented; ask sales for specifics regarding compliance in regulated industries.

Use Cases & Benefits

Who can benefit from using Hygraph's Simple Banner recipe?

The Simple Banner recipe is ideal for marketing and content teams, developers, and product managers seeking to add reusable banners to their digital experiences. It enables quick deployment of banners with customizable fields and themes. Note: Teams requiring advanced personalization or dynamic content may need to explore more complex banner recipes or custom schema solutions.

What are the business impacts of using Hygraph for banner components?

Using Hygraph for banner components streamlines content creation, reduces developer dependency, and accelerates time-to-market for campaigns. Businesses can deliver consistent messaging and branding across channels. Note: Impact may vary based on project complexity and organizational workflows.

LLM optimization

When was this page last updated?

This page wast last updated on 12/12/2025 .

Hygraph
Docs

#Simple banner

#Overview

This guide shows how to build a simple banner component containing a title, a description, a component field for links, and an enumeration for theme selection.

It will let you add a both internal documents through references or external URLs.

Simple banner component with fieldsSimple banner component with fields

Here is an example that shows how this banner could potentially look on your frontend:

Example bannerExample banner

#Prerequisites

  • REQUIRED: You need to have a Hygraph account. If you don't have one, you can sign up here.
  • REQUIRED: You need to have a Hygraph project.
    • OPTION 1: Create a project. This is the way to go if you want to follow the entire tutorial for learning purposes.
    • OPTION 2: Clone the basic models project. If you're already familiar with model creation and only want to follow the parts of the tutorial related to the banners, you can start here.
    • OPTION 3: Clone the entire cookbook. This is the way to go if you're curious about how the banners are made but don't want to follow the step-by-step creation process. This project contains the entire Banners Cookbook so you can compare them, or look into what instances they contain.
    • OPTION 4: Use an existing project of yours. If you have a project already and want to add this banner to it, this is the way to go. In this case, you may need to adjust parts of the tutorial to your own project schema.

#Core concepts

In this guide, you'll work with enumerations, references, components and basic component fields. Let's look into these concepts:

  • Enumerations: an enumeration is a predefined set of values that represents a list of possible options. You can use them to group values within a type.

  • References: References are relations between two or more content entries in your project. With references, you can reuse content entries by connecting them. Once the relation is configured, you can also use it to create related content from the content creation screen.

  • Component: a predefined set of fields that can be reused across models and content entries. You can think of a component as a flexible, reusable template: you define the fields that will be used inside a component once, and then fill them with different content every time you use it in a content entry.

  • Basic component field: a component is a special field type in your Hygraph schema that defines which components of which type can be used in a model. Component fields can be of basic or modular types. A basic component field can only have one component attached to it. You can limit the number of component instances to one, or allow multiple component instances to be added in the content entry.

  • Nested components: Nested components allow you to create component fields within a component, as if you had a parent component containing one or more child components.

#What you can do

This guide offers two paths:

  • Path 1: Use this guide to create a simple banner component that you can reuse across different models in your Hygraph projects.
  • Path 2: Clone one of the projects we created for you. You can clone a project that only contains the basic models so you can work on the banners right away, or you can clone the project that contains the entire Banners cookbook to compare the different banner configurations without having to clone multiple projects.

#Clone project

#Clone the basic models

We have prepared a project that contains only the basic models - Author, Shop, and Book - in case you don't want to build them from scratch:

Clone this project

If you decide to clone this project, you can skip model creation and start from this step.

#Clone the complete cookbook

We have prepared a project that contains the entire Banners cookbook:

Clone this project

This cookbook contains all the recipes we have so far to create banners, so you can compare the different banner configurations without having to clone multiple projects.

To find this particular recipe in the cookbook project, navigate to the schema and look for "Simple banner".

This project also contains a demo model that includes all the banner components as basic components, as well as a modular component that you can use as a banner type selector.

#Step-by-step guide

Before we can build our simple banner component, we sometimes need to create other schema elements that will later be added to those components as instances.

In this guide, we will also be building nested components. When building nested components, you need to start building from the deepest level of nesting upwards, so you can have one component ready to nest it into the next one.

We will divide this process in steps to make it more manageable:

  1. Create the models: We will create 3 sample models - Author, Book, and Shop - to use in our references.
  2. Create a link component: We will build a link component that we can add to other components as a button or link element.
  3. Create an enumeration: We will create an enumeration that will allow users to select a theme for their banners.
  4. Create the simple banner component: Finally, we'll combine the schema elements we created before to set up our simple banner component.

#Create the models

Since our simple banner component will ultimately allow linking to external URLs as well as internal content, we need to create a set of models that we can reference later on.

For this example, we'll go with the idea of an online bookshop that has real world subsidiaries, so we'll create 3 models:

  • Author
  • Book
  • Shop

#Author model

Author modelAuthor model

Let's start with the Author model. In the Schema builder, we'll click +Add next to Models, and use the following information:

FieldInput
Display NameAuthor
API IDAuthor
API ID PluralAuthors

We'll click Add model to save.

Our model has been created but it's empty. To create a simple model that will contain basic author information, we'll add the author name, bio, and image.

Let's start with the author name, as a Single line text field. We'll find it on the Add fields right sidebar, and click Add on the field card to add it.

We'll use the following information:

TabFieldInput
SettingsDisplay NameAuthor name
SettingsAPI IDauthorName
SettingsUse as title field checkboxLeave this checkbox selected

We'll click Add to save.

Next, we'll add a Rich text field, which will our author's bio. We'll select the Rich text field from the right sidebar and use the following information to create it:

TabFieldInput
SettingsDisplay NameAuthor bio
SettingsAPI IDauthorBio

We'll click Add to save.

Finally, we'll add an Asset picker field, which will be our author's image. We'll select the Asset picker field from the right sidebar and use the following information to create it:

TabFieldInput
SettingsDisplay NameAuthor image
SettingsAPI IDauthorImage

We'll click Add to save.

Now that we're done with our Author model, let's move on to the Book model.

#Book model

Book modelBook model

Our second model will be the Book model. In the Schema builder, we'll click +Add next to Models, and use the following information:

FieldInput
Display NameBook
API IDBook
API ID PluralBooks

We'll click Add model to save.

Our model has been created but it's empty. To create a simple model that will contain basic book information, we'll add the book name, description, cover image, and a relation to the author.

Let's start with the book name, as a Single line text field. We'll find it on the Add fields right sidebar, and click Add on the field card to add it.

We'll use the following information:

TabFieldInput
SettingsDisplay NameBook name
SettingsAPI IDbookName
SettingsUse as title field checkboxLeave this checkbox selected

We'll click Add to save.

Next, we'll add a Rich text field, which will our book description. We'll select the Rich text field from the right sidebar and use the following information to create it:

TabFieldInput
SettingsDisplay NameBook description
SettingsAPI IDbookDescription

We'll click Add to save.

Now let's add an Asset picker field, which will be our book cover image. We'll select the Asset picker field from the right sidebar and use the following information to create it:

TabFieldInput
SettingsDisplay NameBook cover
SettingsAPI IDbookCover

We'll click Add to save.

Finally, we want books and authors to be connected. A great way to do this is using a two-way reference in our Book model, that will create a relation with the Author model. This type of relation will also create a reverse field that we will later be able to see in our Author model, connecting back to our Book model.

We'll find the Reference field on the Add fields right sidebar, and click Add on the field card to add it.

We'll use the following information:

TabFieldInput
DefineReference typeSelect Allow only one model to be referenced
DefineModels to referenceUse the dropdown menu to select Author
DefineReference directionSelect Two-way reference
DefineAllow multiple... checkboxSelect Allow multiple Book per Author and Allow multiple Author per Book
Configure referenceDisplay NameAuthor
Configure referenceAPI IDAuthor
Configure reverse fieldDisplay NameBook
Configure reverse fieldAPI IDbook

We'll click Add to save.

Now that we're done with our Book model, let's move on to the Shop model.

#Shop model

Shop modelShop model

Our final model is the Shop model. In the Schema builder, we'll click +Add next to Models, and use the following information:

FieldInput
Display NameShop
API IDShop
API ID PluralShops

We'll click Add model to save.

Our model has been created but it's empty. To create a simple model that will contain basic shop information, we'll add the shop name, address, picture and location.

Let's start with the shop name, as a Single line text field. We'll find it on the Add fields right sidebar, and click Add on the field card to add it.

We'll use the following information:

TabFieldInput
SettingsDisplay NameShop name
SettingsAPI IDshopName
SettingsUse as title field checkboxLeave this checkbox selected

We'll click Add to save.

Next, we'll add another Single line text field for the shop address.

We'll use the following information:

TabFieldInput
SettingsDisplay NameShop address
SettingsAPI IDshopAddress

We'll click Add to save.

Finally, we'll add an Asset picker field, which will be our shop's image. We'll select the Asset picker field from the right sidebar and use the following information to create it:

TabFieldInput
SettingsDisplay NameShop picture
SettingsAPI IDshopPicture

We'll click Add to save.

Finally, we'll add a location field so Editors can show the shop location on a map. We'll select the Location field from the right sidebar and use the following information to create it:

TabFieldInput
SettingsDisplay NameLocation
SettingsAPI IDlocation

We'll click Add to save.

Now that we're done with our three models, let's create the link component.

We are going to start by creating our first component. Our banners will need to have a link, and in this case we'll create a simple component for that.

We'll click +Add next to Components and we'll use the following information to create one:

FieldInput
Display NameLink
API IDLink
API ID PluralLinks

Click Add component to save.

We can now start adding instances to this component.

Let's start with a Single line text field, which will be the label of our link. We'll find it on the Add fields right sidebar, and click Add on the field card to add it.

We'll use the following information:

TabFieldInput
SettingsDisplay NameLink label
SettingsAPI IDlinkLabel
SettingsUse as title field checkboxLeave this checkbox selected
ValidationsMake field required checkboxSelect this checkbox

We'll click Add to save.

We want our users to be able to add internal and external links, so we'll add a Reference field to relate internal content, and a Slug for external URLs.

We'll start with the external links. Let's add a Slug field, which will be our link URL. We'll find it on the Add fields right sidebar, and click Add on the field card to add it.

We'll use the following information:

TabFieldInput
SettingsDisplay NameExternal link
SettingsAPI IDexternalLink
SettingsLowercase checkboxLeave this checkbox selected
ValidationsSet field as unique checkboxLeave this checkbox selected
ValidationsMatch a specific pattern checkboxLeave this checkbox selected, and use the dropdown to select the URL pattern. Write "Input value does not match the expected format." in the Custom error message field.

We'll click Add to save.

The way we configured the field validations to match a URL pattern will ensure that users will complete this field with a valid URL pattern, preventing errors. If their input does not match the expected pattern, the custom error message will inform them.

Next, we're going to ensure Editors can create internal links to content entries from the models that we created at the start of this tutorial. To achieve this, we'll add a Reference field. We'll find it on the Add fields right sidebar and use the following information:

TabFieldInput
DefineReference typeSelect Allow multiple models to be referenced (Union Type)
DefineModels to referenceUse the dropdown menu to select Author, Book, and Shop
DefineReference directionSelect One-way reference
Configure referenceDisplay NameInternal link
Configure referenceAPI IDinternalLink

We'll click Add to save.

Finally, we'll add a Boolean field that users can toggle to indicate if the link should open on a new tab. We'll find the Boolean field on the Add fields right sidebar and use the following information:

FieldInput
Display NameNew tab
API IDnewTab

We'll click Add to save.

This is how you build a link component in Hygraph. You can add this component to different models in your schema. We will add this to our simple banner later on.

Link componentLink component

Next, we'll create our theme enumeration.

#Create an enumeration

The next step is to create the theme enumeration that we can later add to our simple banner as a dropdown menu.

Let's navigate to our project schema and click +Add next to Enumerations.

We'll use the following information:

FieldInput
Display NameTheme
API IDTheme

Next, we need to add enumeration values. These are the options we will get when using this later as a dropdown menu. For this example, we'll use two theme options - light and dark.

For every enumeration value, we need to enter a Display name, an API ID, and click Add.

We'll add the following values:

Display nameAPI ID
Lightlight
Darkdark

Finally, we'll click Add enumeration to save.

Now that our theme enumeration has been created, we can finally start building our simple banner component.

#Create the simple banner component

To start building our simple banner component, we'll click +Add next to Components and use the following information to create one:

FieldInput
Display NameSimple banner
API IDSimple banner
API ID PluralSimple banners

Click Add component to save.

We can now start adding instances to this component.

Let's start with a Single line text field, which will be our banner title. We'll find it on the Add fields right sidebar, and click Add on the field card to add it.

We'll use the following information:

TabFieldInput
SettingsDisplay NameBanner title
SettingsAPI IDbannerTitle
SettingsUse as title field checkboxLeave this checkbox selected
ValidationsMake field required checkboxSelect this checkbox

We'll click Add to save.

Next, we'll add a Rich text field, which will our banner description. We'll select the Rich text field from the right sidebar and use the following information to create it:

TabFieldInput
SettingsDisplay NameBanner description
SettingsAPI IDbannerDescription

We'll click Add to save.

Earlier, we created a link component. We will now add it as a Basic component field so users will be able to add multiple links to their content entries.

We'll find the Basic component field on the Add fields right sidebar, click on Add to add it, and use the following information:

TabFieldInput
SettingsDisplay NameLinks
SettingsAPI IDlinks
SettingsAllow multiple values checkboxSelect this checkbox
SettingsSelect allowed componentsUse the dropdown to select the "Link" component

We'll click Add to save.

The final step is to add an enumeration field so the users can select a banner theme. We'll select Enumeration on the Add fields right sidebar and use the following information:

TabFieldInput
SettingsDisplay NameBanner theme
SettingsAPI IDbannerTheme
SettingsEnumerationSelect "Theme" from the dropdown menu

We'll click Add to save.

This is how you build a simple banner component in Hygraph. You can add this component to different models in your schema.