Input settings can hold a value and are configurable by merchants.
Input settings are generally composed of standard attributes , and there are two categories:
To learn how to access the values of these settings for use in your theme, refer to the settings overview .
If you want to add informational elements to your settings display, like a heading, then refer to Sidebar settings .
The following are standard attributes across input settings. However, depending on the input type, there might be extra attributes or some might not apply:
The following are the basic input setting types:
A setting of type
checkbox
outputs a checkbox field. These fields can be used for toggling features on and off, such as whether to show an announcement bar.
For example, the following setting generates the following output:
If
default
is unspecified, then the value is
false
by default.
A setting of type
number
outputs a single number field. In addition to the
standard attributes
of an input setting,
number
type settings have the following attribute:
A placeholder value for the input.
These values only appear for settings defined in
settings_schema.json
. They don't appear for settings defined in a section's schema.
You can use these fields to capture a varying numerical value, such as the number of products to show per page on a collection page.
For example, the following setting generates the following output:
When accessing the value of a
number
type setting, data is returned as one of the following:
default
attribute is optional. However, the value must be a number and not a string. Failing to adhere results in an error.
A setting of type
radio
outputs a radio option field. In addition to the
standard attributes
of an input setting,
radio
type settings have a required
options
attribute that accepts an array of
value
and
label
definitions.
You can use these fields to capture a multi-option selection, such as the alignment of a header logo.
For example, the following setting generates the following output:
If
default
is unspecified, then the first option is selected by default.
A setting of type
range
outputs a range slider field with an input field. In addition to the
standard attributes
of an input setting,
range
type settings have the following attributes:
You can use these fields to capture a varying numerical value, such as font size.
You can update the
range
value using the provided slider, or by typing a value into the input field:
step
definition, then the value rounds to the closest step.
min
and
max
, then the value reverts to the
min
or
max
value accordingly.
For example, the following setting generates the following output:
default
attribute is required. The
min
,
max
,
step
, and
default
attributes can't be string values. Failing to adhere results in an error.
A setting of type
select
outputs
different selector fields
, depending on certain criteria. In addition to the
standard attributes
of an input setting,
select
type settings have the following attributes:
group
An optional attribute that you can add to each option to create option groups in the drop-down.
The following criteria render selector fields as either a
DropDown
or a
SegmentedControl
:
You can use these fields to capture a multi-option selection, such as the vertical alignment of slideshow text.
For example, the following setting generates the following output:
If
default
is unspecified, then the first option is selected by default.
A setting of type
text
outputs a single-line text field. In addition to the
standard attributes
of an input setting,
text
type settings have the following attribute:
A placeholder value for the input.
These values only appear for settings defined in
settings_schema.json
. They don't appear for settings defined in a section's schema.
When accessing the value of a
text
type setting, data is returned as one of the following:
empty
object
, if nothing has been entered.
text
are not updated when switching presets.
A setting of type
textarea
outputs a multi-line text field. In addition to the
standard attributes
of an input setting,
textarea
type settings have the following attribute:
A placeholder value for the input.
These values only appear for settings defined in
settings_schema.json
. They don't appear for settings defined in a section's schema.
When accessing the value of a
textarea
type setting, data is returned as one of the following:
empty
object
, if nothing has been entered.
The following are the specialized input setting types:
A setting of type
article
outputs an article picker field that's automatically populated with the available articles for the store. You can use these fields to capture an article selection, such as the article to feature on the homepage.
For example, the following setting generates the following output:
When accessing the value of an
article
type setting, data is returned as one of the following:
An
article
object
.
To ensure backwards compatibility with legacy resource-based settings , outputting the setting directly will return the object's handle.
blank
if no selection has been made, the selection isn't visible, or the selection no longer exists.
article
are not updated when switching presets.
article
settings also don't support the
default
attribute.
A setting of type
blog
outputs a blog picker field that's automatically populated with the available blogs for the store. You can use these fields to capture a blog selection, such as the blog to feature in the sidebar.
For example, the following setting generates the following output:
When accessing the value of a
blog
type setting, data is returned as one of the following:
A
blog
object
.
To ensure backwards compatibility with legacy resource-based settings , outputting the setting directly will return the object's handle.
blank
, if either no selection has been made or the selection no longer exists.
blog
are not updated when switching presets.
blog
settings also don't support the
default
attribute.
A setting of type
collection
outputs a collection picker field that's automatically populated with the available collections for the store. You can use these fields to capture a collection selection, such as a collection for featuring products on the homepage.
For example, the following setting generates the following output:
When accessing the value of a
collection
type setting, data is returned as one of the following:
To ensure backwards compatibility with legacy resource-based settings , outputting the setting directly will return the object's handle.
blank
, if no selection has been made, the selection isn't visible, or the selection no longer exists.
collection
are not updated when switching presets.
collection
settings also don't support the
default
attribute.
A setting of type
collection_list
outputs a collection picker field that's automatically populated with the available collections for the store. You can use these fields to capture multiple collections, such as a group of collections to feature on the homepage.
In addition to the
standard attributes
of an input setting,
collection_list
type settings have the following attributes:
limit
The maximum number of collections that the merchant can select. The default limit, and the maximum limit you can set, is 50.
When accessing the value of a
collection_list
type setting, data is returned as one of the following:
An array of
collection
objects
.
This array supports pagination using the
paginate
tag. You can also append
.count
to the
setting key
to return the number of collections in the array.
blank
if no selection has been made, the selection isn't visible, or the selection no longer exists.
A setting of type
color
outputs a color picker field. You can use these fields to capture a color selection for various theme elements, such as the body text color.
For example, the following setting generates the following output:
When accessing the value of a
color
type setting, data is returned as one of the following:
color
object
.
blank
, if no selection has been made.
A setting of type
color_background
outputs a text field for entering
CSS background
properties. You can use these fields to capture background settings for various theme elements, such as the store background.
color_background
do not support image related background properties.
For example, the following setting generates the following output:
When accessing the value of a
color_background
type setting, data is returned as one of the following:
A setting of type
color_scheme
outputs a picker with all of the available theme color schemes, and a preview of the selected color scheme. Theme color schemes in the picker are defined using the
color_scheme_group
setting.
You can apply a color scheme to sections, blocks and general theme settings. Color scheme settings aren't supported in app blocks.
For example, the following setting generates the following output:
When accessing the value of a
color_scheme
type setting, Shopify returns the selected
color_scheme
object from
color_scheme_group
.
If no value was entered, or the value was invalid, then the default value from
color_scheme
is returned. If the default value is also invalid, then the first
color_scheme
from
color_scheme_group
is returned.
If the theme doesn't have
color_scheme_group
data in
settings_data.json
, then
nil
is returned.
A setting of type
color_scheme_group
outputs a color scheme which is composed of the following input setting types:
header
color
color_background
Color schemes can be added only in
settings_schema.json
.
For example, the following setting generates the following output:
The
role
field outputs a color scheme preview. The color scheme previews are visible to merchants anywhere in the editor where they might pick a color scheme. You can assign roles to your color scheme definitions to map the color scheme to the previews. For example you can assign
role.background
to the
Background
definition. Role uses the following standardized mapping of the
color_scheme_group
definition to the color scheme preview:
role.background
Renders the background color of the preview
Optional
role.text
Renders the text color of the preview
role.primary_button
role.secondary_button
Render the 1st and 2nd pills in the preview
Optional
role.primary_button_border
role.secondary_button_border
Render the 1st and 2nd pills' border in the preview
role.on_primary_button
role.on_secondary_button
Aren't used in the preview
role.links
role.icons
Aren't used in the preview
A setting of type
font_picker
outputs a font picker field that's automatically populated with fonts from the
Shopify font library
. This library includes web-safe fonts, a selection of Google Fonts, and fonts licensed by Monotype.
You can use these fields to capture a font selection for various theme elements, such as the base heading font.
For example, the following setting generates the following output:
When accessing the value of a
font_picker
type setting, data is returned as a
font
object
.
default
attribute is required. Failing to include it will result in an error. You can find the possible values through the
available fonts
in the Shopify font library.
A setting of type
html
outputs a multi-line text field that accepts HTML markup. In addition to the
standard attributes
of an input setting,
html
type settings have the following attribute:
You can use these fields to capture custom blocks of HTML content, such as a video embed.
For example, the following setting generates the following output:
When accessing the value of an
html
type setting, data is returned as one of the following:
empty
object
, if nothing has been entered.
A setting of type
image_picker
outputs an image picker field that's automatically populated with the available images from the
Files
section of Shopify admin, and has the option to upload new images. Merchants also have an opportunity to enter alt text and select a
focal point
for their image.
You can use these fields to capture an image selection, such as logos, favicons, and slideshow images.
For example, the following setting generates the following output:
When accessing the value of an
image_picker
type setting, data is returned as one of the following:
image
object
.
image_picker
are not updated when switching presets.
image_picker
settings also don't support the
default
attribute.
Images selected using an
image_picker
setting support focal points. A focal point is a position in an image that the merchant wants to remain in view as the image is cropped and adjusted by the theme. Focal points can be set in the theme editor
image_picker
setting, or from the
Files
page.
To make sure that your theme respects the focal point of the image, do the following:
image_tag
filter.
object-fit: cover
.
Using
image_tag
, if a focal point was provided, then an
object-position
style is added to the image tag, with the value set to the focal point.
If you need override the
object-position
style for a specific use case, then pass a
style: object-position: inherit;
property to the
image_tag
filter.
You can also access the focal point data using
image.presentation.focal_point
.
A setting of type
inline_richtext
outputs HTML markup that isn't wrapped in paragraph tags (
<p>
). The setting includes the following basic formatting options:
inline_richtext
setting doesn't support the following features:
<br>
)
CMD
+
U
or
CTRL
+
U
keyboard shortcut.
You can use these fields to capture formatted text content, such as introductory brand content on the homepage.
For example, the following setting generates the following output:
When accessing the value of a
inline_richtext
type setting, data is returned as one of the following:
empty
object
, if nothing has been entered.
A setting of type
link_list
outputs a menu picker field that's automatically populated with the available menus for the store. You can use these fields to capture a menu selection, such as the menu to use for footer links.
For example, the following setting generates the following output:
When accessing the value of a
link_list
type setting, data is returned as one of the following:
linklist
object
.
blank
, if either no selection has been made or the selection no longer exists.
default
attribute are
main-menu
and
footer
.
A setting of type
liquid
outputs a multi-line text field that accepts HTML and
limited
Liquid markup. You can use these fields to capture custom blocks of HTML and Liquid content, such as a product-specific message. Merchants can also use a liquid setting to add the code needed to integrate certain types of
apps
into your theme.
For example, the following setting generates the following output:
When accessing the value of a
liquid
type setting, data is returned as one of the following:
empty
object
, if nothing has been entered.
default
attribute is optional. However, if you use it, then its value can't be an empty string. Additionally, unclosed HTML tags are automatically closed when the setting is saved. This might not line up with your intended formatting, so be sure to verify your input.
Settings of type
liquid
don't have access to the following liquid objects/tags:
However,
liquid
settings can access the following:
collection
,
product
, etc. (within their respective templates)
If your content includes non-existent, or empty, Liquid tags, then they will be rendered as empty strings. For example, the following setting generates the following output:
A setting of type
page
outputs a page picker field that's automatically populated with the available pages for the store. You can use these fields to capture a page selection, such as the page to feature content for in a size-chart display.
For example, the following setting generates the following output:
When accessing the value of a
page
type setting, data is returned as one of the following:
A
page
object
.
To ensure backwards compatibility with legacy resource-based settings , outputting the setting directly will return the object's handle.
blank
, if no selection has been made, the selection isn't visible, or the selection no longer exists.
page
are not updated when switching presets.
page
settings also don't support the
default
attribute.
A setting of type
product
outputs a product picker field that's automatically populated with the available products for the store. You can use these fields to capture a product selection, such as the product to feature on the homepage.
For example, the following setting generates the following output:
When accessing the value of a
product
type setting, data is returned as one of the following:
A
product
object
.
To ensure backwards compatibility with legacy resource-based settings , outputting the setting directly will return the object's handle.
blank
if no selection has been made, the selection isn't visible, or the selection no longer exists.
product
are not updated when switching presets.
product
settings also don't support the
default
attribute.
A setting of type
product_list
outputs a product picker field that's automatically populated with the available products for the store. You can use these fields to capture multiple products, such as a group of products to feature on the homepage.
In addition to the
standard attributes
of an input setting,
product_list
type settings have the following attributes:
limit
The maximum number of products that the merchant can select. The default limit, and the maximum limit you can set, is 50.
When accessing the value of a
product_list
type setting, data is returned as one of the following:
An array of
product
objects
.
This array supports pagination using the
paginate
tag. You can also append
.count
to the
setting key
to return the number of products in the array.
blank
if no selection has been made, the selection isn't visible, or the selection no longer exists.
A setting of type
richtext
outputs a multi-line text field with the following basic formatting options:
CMD
+
U
or
CTRL
+
U
keyboard shortcut.
You can use these fields to capture formatted text content, such as introductory brand content on the homepage.
For example, the following setting generates the following output:
When accessing the value of a
richtext
type setting, data is returned as one of the following:
empty
object
, if nothing has been entered.
The
default
attribute isn't required. However, if it's used, then only
<p>
or
<ul>
tags are supported as top-level elements.
The following HTML tags are also supported inside the parent
<p>
tag:
<strong>
default
content in
<p>
or
<ul>
tags will result in an error.
A setting of type
text_alignment
outputs a
SegmentedControl
field with icons. In addition to the
standard attributes
of an input setting,
text_alignment
type settings support the following attribute:
left
,
right
,
center
. The default value is
left
.
When you access the value of a
text_alignment
type setting, data is returned as a
string
.
left
option is selected by default.
A setting of type
url
outputs a URL entry field where you can manually enter external URLs and relative paths. It also has a picker that's automatically populated with the following available resources for the shop:
You can use these fields to capture a URL selection, such as the URL to use for a slideshow button link.
For example, the following setting generates the following output:
When accessing the value of a
url
type setting, data is returned as one of the following:
default
attribute are
/collections
and
/collections/all
.
A setting of type
video
outputs a video picker that's automatically populated with the available videos from the
Files
section of the Shopify admin. The merchant also has the option to upload new videos.
For example, the following setting generates the following output:
The
video
type setting also accepts metafields of type
file_reference
as a
dynamic source
.
When accessing the value of a
video
type setting, data is returned as one of the following:
video
object
.
file_reference
metafield that points to a non-video file.
video
settings don't support the
default
attribute.
A setting of type
video_url
outputs a URL entry field. In addition to the
standard attributes
of an input setting,
video_url
type settings have the following attributes:
accept
Takes an array of accepted video providers. Valid values are
youtube
,
vimeo
, or both.
placeholder
A placeholder value for the input.
These fields can be used to capture a video URL from YouTube and/or Vimeo, such as the URL for a static video to show in the product description.
For example, the following setting generates the following output:
When accessing the value of a
video_url
type setting, data is returned as one of the following:
Additionally, there's access to the
id
and
type
(YouTube or Vimeo) of the video.
For example, assuming you're using this video with the above setting, the following Liquid generates the following output:
You can
add links
to the
info
settings attribute by enclosing the link text in brackets and then following it immediately with the URL in parentheses.
For example, the following setting generates the following output:
Thanks! We’ll be in touch.