Secondary Tile
Secondary tiles are used for presenting secondary pieces of information on a page, such as accessories or product options. (For presenting products or major choices, use Standard Tile instead.)
Playground
Secondary Tile is typically used in conjunction with the grid in order to lay out a number of tiles in a row.
<GridContainer><Row><Column span={3}><SecondaryTile><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>Name</SecondaryTileName></SecondaryTileContents></SecondaryTile></Column><Column span={3}><SecondaryTile><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400?q=1"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileBadges><Badge>New</Badge></SecondaryTileBadges><SecondaryTileName>Name</SecondaryTileName></SecondaryTileContents></SecondaryTile></Column><Column span={3}><SecondaryTile><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400?q=2"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>Name</SecondaryTileName><SecondaryTileBadges><Badge skin="discount">60% off</Badge></SecondaryTileBadges></SecondaryTileContents></SecondaryTile></Column><Column span={3}><SecondaryTile><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400?q=3"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>Name</SecondaryTileName><SecondaryTilePrice>100 Starting at $X.YZ</SecondaryTilePrice></SecondaryTileContents></SecondaryTile></Column></Row></GridContainer>
<div class="grid-container"><div class="row"><div class="col-3"><div class="secondary-tile"><div class="secondary-tile-image"><!-- responsive image goes here--></div><div class="secondary-tile-contents"><div class="secondary-tile-name">Name</div></div></div></div><div class="col-3"><div class="secondary-tile"><div class="secondary-tile-image"><!-- responsive image goes here--></div><div class="secondary-tile-contents"><div class="secondary-tile-badges"><span class="badge all-caps">New</span></div><div class="secondary-tile-name">Name</div></div></div></div><div class="col-3"><div class="secondary-tile"><div class="secondary-tile-image"><!-- responsive image goes here--></div><div class="secondary-tile-contents"><div class="secondary-tile-name">Name</div><div class="secondary-tile-badges"><span class="badge badge-skin-discount all-caps">60% off</span></div></div></div></div><div class="col-3"><div class="secondary-tile"><div class="secondary-tile-image"><!-- responsive image goes here--></div><div class="secondary-tile-contents"><div class="secondary-tile-name">Name</div><div class="secondary-tile-price">100 Starting at $X.YZ</div></div></div></div></div></div>
Usage
Secondary Tile is composed of a number of sub-components. (The React components are named below. The vanilla API uses CSS classes with similar names.)
SecondaryTile
itself typically has two children:
SecondaryTileImage
- wrapper for the imageSecondaryTileContents
- wrapper for the contents
Inside of the SecondaryTileContents
there are more sub-components, all of which are optional except for the name:
SecondaryTileName
SecondaryTilePrice
SecondaryTileNameWithPrice
- optional wrapper which allows the name and price to be on the same lineSecondaryTileBadges
- wrapper for anyBadge
sSecondaryTileDescription
Secondary Tiles as Links
If the entire tile is clickable as a link that takes the user to another page, you should make the tile an <a> tag.
<SecondaryTile component="a" href="someurl" />
<a class="secondary-tile" href="someurl"></a>
Note that the component
property can accept any React component as well as any HTML tag, so if you're using React Router's Link component, you could also pass component={Link}! /
Any Secondary Tile that is an <a>
tag will have its height equalized, so that all such tiles in the same grid row will have the same visible height.
Hover
If a clickable tile doesn't have a "CTA link" appearance (see below), we recommend adding class secondary-tile-shadow-hover
to give the tile a drop shadow when hovered over, to provide some affordance that the tile is clickable.
/*not yet natively supported in the React component,but you can add the className to the Secondary Tile*/
<a href="somehref" class="secondary-tile secondary-tile-shadow-hover"></a>
If a clickable tile has just a name and no other accompanying information (no price, badge, etc), you should add the "CTA link" look to the tile's name.
<GridContainer><Row><Column span={6}><SecondaryTile component="a"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400?q=1"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>Name</SecondaryTileName><SecondaryTileDescription>Description</SecondaryTileDescription></SecondaryTileContents></SecondaryTile></Column><Column span={6}><SecondaryTile component="a"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400?q=2"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName skin="cta">Name with CTA skin</SecondaryTileName></SecondaryTileContents></SecondaryTile></Column></Row></GridContainer>
Inside a Selection Set
Secondary Tile is commonly used with Selection Set in order to display a set of options with images.
Just place a Secondary Tile inside a Selection Set's label (in React, right inside the SelectionSetLabel
component).
<SelectionSet defaultSelectedValue="B"><SelectionSetInput value="A"><SelectionSetLabel><SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>A</SecondaryTileName><SecondaryTileDescription>Description</SecondaryTileDescription><SecondaryTilePrice>$1.00</SecondaryTilePrice></SecondaryTileContents></SecondaryTile></SelectionSetLabel></SelectionSetInput><SelectionSetInput value="B"><SelectionSetLabel><SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400?q=1"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>B</SecondaryTileName><SecondaryTileDescription>Description</SecondaryTileDescription><SecondaryTilePrice>$1.00</SecondaryTilePrice></SecondaryTileContents></SecondaryTile></SelectionSetLabel></SelectionSetInput></SelectionSet>
Badges
You can add a Badge to a Secondary Tile. The Badge(s) goes inside a "badges container" that typically sits at the top or bottom of the contents container.
<GridContainer><Row><Column span={6}><SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileBadges><Badge>New</Badge></SecondaryTileBadges><SecondaryTileName>Name</SecondaryTileName><SecondaryTileDescription>Description</SecondaryTileDescription></SecondaryTileContents></SecondaryTile></Column><Column span={6}><SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400?q=1"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>Name</SecondaryTileName><SecondaryTileDescription>Description</SecondaryTileDescription><SecondaryTileBadges><Badge skin="discount">60% off</Badge></SecondaryTileBadges></SecondaryTileContents></SecondaryTile></Column></Row></GridContainer>
<SecondaryTileContents><SecondaryTileBadges><Badge>New</Badge></SecondaryTileBadges><SecondaryTileName>Name</SecondaryTileName><SecondaryTileDescription>Description</SecondaryTileDescription></SecondaryTileContents>
<div class="secondary-tile-contents"><div class="secondary-tile-badges"><span class="badge">New</span></div><div class="secondary-tile-name">Name</div><div class="secondary-tile-description">Description</div></div>
Horizontal tiles
Secondary Tiles can be made horizontal, so that the image sits to the left of the contents.
<GridContainer><Row><Column span={6}><SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileName>Name</SecondaryTileName><SecondaryTileDescription>Description</SecondaryTileDescription></SecondaryTileContents></SecondaryTile></Column></Row></GridContainer>
<SecondaryTile layout="horizontal" />
<div class="secondary-tile secondary-tile-horizontal"></div>
Price Positioning
For horizontal tiles, if you'd like to show the price on the same line as the name, you can utilize the "name with price" sub-component. It then wraps both the name and the price.
<GridContainer><Row><Column span={6}><SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileNameWithPrice><SecondaryTileName>Name</SecondaryTileName><SecondaryTilePrice>$1.00</SecondaryTilePrice></SecondaryTileNameWithPrice><SecondaryTileDescription>Description</SecondaryTileDescription></SecondaryTileContents></SecondaryTile></Column></Row></GridContainer>
<SecondaryTileContents><SecondaryTileNameWithPrice><SecondaryTileName>Name</SecondaryTileName><SecondaryTilePrice>$1.00</SecondaryTilePrice></SecondaryTileNameWithPrice><SecondaryTileDescription>Description</SecondaryTileDescription></SecondaryTileContents>
<div class="secondary-tile-contents"><div class="secondary-tile-name-with-price"><div class="secondary-tile-name">Name</div><div class="secondary-tile-price">$1.00</div></div><div class="secondary-tile-description">Description</div></div>
Launcher
Sometimes we add a launcher button that launches a dialog where the user can select an option. The button typically displays the currently-selected value, and the adjacent label describes the button.
<GridContainer><Row><Column span={6}><SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImageaspectRatio={1}src="https://picsum.photos/400/400"/></SecondaryTileImage><SecondaryTileContents><SecondaryTileNameWithPrice><SecondaryTileName>Name</SecondaryTileName><SecondaryTilePrice>$1.00</SecondaryTilePrice></SecondaryTileNameWithPrice><SecondaryTileDescription>Description</SecondaryTileDescription><SecondaryTileLabeledInput><SecondaryTileLabeledInputLabel>Qty</SecondaryTileLabeledInputLabel><SecondaryTileLabeledInputButton>1000<VisuallyHidden>(Click to change quantity)</VisuallyHidden></SecondaryTileLabeledInputButton></SecondaryTileLabeledInput></SecondaryTileContents></SecondaryTile></Column></Row></GridContainer>
<SecondaryTile layout="horizontal"><SecondaryTileImage><BasicResponsiveImage aspectRatio={1} src="https://picsum.photos/400/400" /></SecondaryTileImage><SecondaryTileContents><SecondaryTileNameWithPrice><SecondaryTileName>Name</SecondaryTileName><SecondaryTilePrice>$1.00</SecondaryTilePrice></SecondaryTileNameWithPrice><SecondaryTileDescription>Description</SecondaryTileDescription><SecondaryTileLabeledInput><SecondaryTileLabeledInputLabel>Qty</SecondaryTileLabeledInputLabel><SecondaryTileLabeledInputButton>1000<VisuallyHidden>(Click to change quantity)</VisuallyHidden></SecondaryTileLabeledInputButton></SecondaryTileLabeledInput></SecondaryTileContents></SecondaryTile>
Components
SecondaryTile
Prop | Type | Default | Description |
---|---|---|---|
layout | "horizontal" | "vertical" | vertical | Whether the tile is vertically or horizontally oriented |
All other props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
SecondaryTileBadges
SecondaryTileBadges
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
SecondaryTileContents
SecondaryTileContents
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
SecondaryTileDescription
SecondaryTileDescription
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
SecondaryTileImage
SecondaryTileImage
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
SecondaryTileName
Prop | Type | Default | Description |
---|---|---|---|
skin | "standard" | "cta" | standard | The visual style of the StandardTileName |
All other props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
SecondaryTileNameWithPrice
SecondaryTileNameWithPrice
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
SecondaryTilePrice
SecondaryTilePrice
has no props of its own
All props are forwarded to the element specified in thecomponent
prop(default: <div/>
)
Guidelines
Designer Guidelines
Secondary Tiles are used for secondary choices, such as product options or accessories. (If you are choosing from a list of products, use a Standard Tile instead.)
If a vertical Secondary Tile contains only the tile name and no other details, it should use the "CTA link" look.
Accessibility Guidelines
If a sequence of tiles is semantically a list, as is usually the case (e.g. a list of products), then the layout grid elements around the tiles should use
<ul>
and<li>
tags, so that the tiles are grouped semantically into a list. Use<ul>
on the row, and<li>
for the grid elements around the tiles.If the secondary tiles are acting as a set of radio buttons, the wrapper element around the tiles (e.g. the row element) needs the attribute
role="radiogroup"
, plus anaria-labelledby
property whose value is the id of the element that labels the set of radio buttons (e.g. the heading for that page section).If you are using a "launcher" button, it will need accessibility support:
an
aria-labelledby
attribute whose value is the id of the associated label. (React'sSecondaryTileLabeledInputLabel
andSecondaryTileLabeledInputButton
will provide this automatically.)a span inside the button, whose contents provide instruction to the user about what clicking the button does. For instance, this span might say "(Click to change selection)".