diff --git a/src/pages/components/tile/images/tile-style-1.png b/src/pages/components/tile/images/tile-style-1.png new file mode 100644 index 00000000000..c489f8e228c Binary files /dev/null and b/src/pages/components/tile/images/tile-style-1.png differ diff --git a/src/pages/components/tile/images/tile-usage-1.png b/src/pages/components/tile/images/tile-usage-1.png old mode 100755 new mode 100644 index 3b9ba4df374..fba37677eff Binary files a/src/pages/components/tile/images/tile-usage-1.png and b/src/pages/components/tile/images/tile-usage-1.png differ diff --git a/src/pages/components/tile/images/tile-usage-10.png b/src/pages/components/tile/images/tile-usage-10.png new file mode 100644 index 00000000000..e5a0686b1bd Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-10.png differ diff --git a/src/pages/components/tile/images/tile-usage-11.png b/src/pages/components/tile/images/tile-usage-11.png new file mode 100644 index 00000000000..83242602507 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-11.png differ diff --git a/src/pages/components/tile/images/tile-usage-13.png b/src/pages/components/tile/images/tile-usage-13.png new file mode 100644 index 00000000000..a9a9e7d5b88 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-13.png differ diff --git a/src/pages/components/tile/images/tile-usage-14.png b/src/pages/components/tile/images/tile-usage-14.png new file mode 100644 index 00000000000..1801efd5622 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-14.png differ diff --git a/src/pages/components/tile/images/tile-usage-15.png b/src/pages/components/tile/images/tile-usage-15.png new file mode 100644 index 00000000000..a0b9506bf40 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-15.png differ diff --git a/src/pages/components/tile/images/tile-usage-16.png b/src/pages/components/tile/images/tile-usage-16.png new file mode 100644 index 00000000000..921f3fb7c6d Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-16.png differ diff --git a/src/pages/components/tile/images/tile-usage-17.png b/src/pages/components/tile/images/tile-usage-17.png new file mode 100644 index 00000000000..0b49bdc7986 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-17.png differ diff --git a/src/pages/components/tile/images/tile-usage-18.png b/src/pages/components/tile/images/tile-usage-18.png new file mode 100644 index 00000000000..cf9e54f2d86 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-18.png differ diff --git a/src/pages/components/tile/images/tile-usage-19.png b/src/pages/components/tile/images/tile-usage-19.png new file mode 100644 index 00000000000..de1a1a4ae0a Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-19.png differ diff --git a/src/pages/components/tile/images/tile-usage-2.png b/src/pages/components/tile/images/tile-usage-2.png index df4d07a42fd..ac438fe8900 100644 Binary files a/src/pages/components/tile/images/tile-usage-2.png and b/src/pages/components/tile/images/tile-usage-2.png differ diff --git a/src/pages/components/tile/images/tile-usage-20.png b/src/pages/components/tile/images/tile-usage-20.png new file mode 100644 index 00000000000..c5aa5c155c7 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-20.png differ diff --git a/src/pages/components/tile/images/tile-usage-21.png b/src/pages/components/tile/images/tile-usage-21.png new file mode 100644 index 00000000000..aa09c1281db Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-21.png differ diff --git a/src/pages/components/tile/images/tile-usage-22.png b/src/pages/components/tile/images/tile-usage-22.png new file mode 100644 index 00000000000..87c131d2c71 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-22.png differ diff --git a/src/pages/components/tile/images/tile-usage-23.png b/src/pages/components/tile/images/tile-usage-23.png new file mode 100644 index 00000000000..729e9754d3f Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-23.png differ diff --git a/src/pages/components/tile/images/tile-usage-24.png b/src/pages/components/tile/images/tile-usage-24.png new file mode 100644 index 00000000000..9313811f846 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-24.png differ diff --git a/src/pages/components/tile/images/tile-usage-25.png b/src/pages/components/tile/images/tile-usage-25.png new file mode 100644 index 00000000000..1177518b959 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-25.png differ diff --git a/src/pages/components/tile/images/tile-usage-26.png b/src/pages/components/tile/images/tile-usage-26.png new file mode 100644 index 00000000000..74c114b6293 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-26.png differ diff --git a/src/pages/components/tile/images/tile-usage-3.png b/src/pages/components/tile/images/tile-usage-3.png index 054ce560024..17ca7d919b8 100644 Binary files a/src/pages/components/tile/images/tile-usage-3.png and b/src/pages/components/tile/images/tile-usage-3.png differ diff --git a/src/pages/components/tile/images/tile-usage-4.png b/src/pages/components/tile/images/tile-usage-4.png index 972ba475d0a..3e5dfa82e88 100644 Binary files a/src/pages/components/tile/images/tile-usage-4.png and b/src/pages/components/tile/images/tile-usage-4.png differ diff --git a/src/pages/components/tile/images/tile-usage-5.gif b/src/pages/components/tile/images/tile-usage-5.gif new file mode 100644 index 00000000000..de95ca76606 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-5.gif differ diff --git a/src/pages/components/tile/images/tile-usage-5.png b/src/pages/components/tile/images/tile-usage-5.png new file mode 100644 index 00000000000..597921cbe45 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-5.png differ diff --git a/src/pages/components/tile/images/tile-usage-6.png b/src/pages/components/tile/images/tile-usage-6.png new file mode 100644 index 00000000000..b165d6d30e0 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-6.png differ diff --git a/src/pages/components/tile/images/tile-usage-7.png b/src/pages/components/tile/images/tile-usage-7.png new file mode 100644 index 00000000000..c106ae5233f Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-7.png differ diff --git a/src/pages/components/tile/images/tile-usage-8.png b/src/pages/components/tile/images/tile-usage-8.png new file mode 100644 index 00000000000..72f066591cb Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-8.png differ diff --git a/src/pages/components/tile/images/tile-usage-9.png b/src/pages/components/tile/images/tile-usage-9.png new file mode 100644 index 00000000000..2ddd54b60b0 Binary files /dev/null and b/src/pages/components/tile/images/tile-usage-9.png differ diff --git a/src/pages/components/tile/style.mdx b/src/pages/components/tile/style.mdx index 1f5e23b5cb0..e422d856f35 100644 --- a/src/pages/components/tile/style.mdx +++ b/src/pages/components/tile/style.mdx @@ -28,7 +28,7 @@ tabs: ['Usage', 'Style', 'Code', 'Accessibility']
-![Structure and spacing measurements for tile](images/tile-style-2.png) +![Structure and spacing measurements for tile](images/tile-style-1.png)
diff --git a/src/pages/components/tile/usage.mdx b/src/pages/components/tile/usage.mdx index 53e5142cd16..994fbeda8d0 100755 --- a/src/pages/components/tile/usage.mdx +++ b/src/pages/components/tile/usage.mdx @@ -17,20 +17,48 @@ including information, getting started, how-to, next steps, and more. Overview Live demo -Variants +Tile variants +Formatting +Behaviors +Related +References Feedback ## Overview -Carbon ships a basic tile structure that responds to the grid. Tiles have no -pre-set styles for the content within them. You can customize tiles to fit your -specific use case. +Carbon ships a basic tile structure that responds to the grid. Based on the +layout structure, tiles can contain type, images and/or a block of color. As +tiles have no pre-set styles for the content within them, the tile component +usage guidance is purposefully high-level. It focuses specifically on the tile +itself, not the structure of the information or interactive elements that the +tile contains—that type of information will be found in the card pattern. -When using a call-to-action (CTA) within a tile, use a -[secondary button](/components/button/usage). Primary buttons should be reserved -for the most important action a user can take on the page. +#### Tiles versus Cards + +Tiles are simple and foundational. Cards can be very complex. They are built +upon the tile foundation and have various patterns, multiple actions, overflow +menus, selectable features, etc. Carbon does not have a Card pattern yet, but we +link out to several card patterns within our pattern asset library (PAL) +ecosystem below: + +- [Productive vs. Expressive cards](https://pages.github.ibm.com/cdai-design/pal/components/card/overview/) + (Carbon for Cloud & Cognitive) +- [Dashboard cards](https://pages.github.ibm.com/ai-applications/design/patterns/dashboards-v2/overview/#dashboard-cards) + (AI Applications Design) +- [Card](https://www.ibm.com/standards/carbon/components/card) (Carbon for + IBM.com) + +### When to use + +Tiles are reusable components that provide shortcuts to building cards and other +modules. Here are some common use cases for when to use tiles: + +- To contain related groupings of information or actions +- To guide users to take actions or navigate +- To present options for single or multiple selections +- To hide or show large amounts of content ## Live demo @@ -67,8 +95,7 @@ for the most important action a user can take on the page. 'https://react.carbondesignsystem.com/?path=/story/components-tile--default', Angular: 'https://angular.carbondesignsystem.com/?path=/story/components-tiles--basic', - Vue: - 'http://vue.carbondesignsystem.com/?path=/story/components-cvtile--default', + Vue: 'http://vue.carbondesignsystem.com/?path=/story/components-cvtile--default', Vanilla: 'https://the-carbon-components.netlify.com/?nav=tile', }}>{` @@ -85,8 +112,7 @@ for the most important action a user can take on the page. 'https://react.carbondesignsystem.com/?path=/story/components-tile--clickable', Angular: 'https://angular.carbondesignsystem.com/?path=/story/components-tiles--basic', - Vue: - 'http://vue.carbondesignsystem.com/?path=/story/components-cvtile--default', + Vue: 'http://vue.carbondesignsystem.com/?path=/story/components-cvtile--default', Vanilla: 'https://the-carbon-components.netlify.com/?nav=tile', }}>{` {` {`
{` -## Variants +## Tile variants + +Tiles can function or be implemented in four ways—base, clickable, selectable, +or expandable. These variations of tiles are flexible enough to support a +variety of different use cases when building more complicating card features. -All of the images below represent examples of types of content that could be -presented within a tile. The styling in these examples is for illustration only; -you are free to create your own layout and design within a tile. +| Variant | Purpose | +| ------------------------- | -------------------------------------------------------------------------------------------------------- | +| [Base](#base) | For high-level, short, and digestible content pieces such as features, plans, or services offered | +| [Clickable](#clickable) | For prompting an action, navigating or directing to other pieces of information about the subject matter | +| [Selectable](#selectable) | For presenting options to a user in a structured manner, such as a set of pricing plans | +| [Expandable](#expandable) | For hiding and revealing a large amount of content in order to focus on specific pieces of info | -### Read-only +### Base -Read-only tiles are used to display information to the user, such as features or -services offered. Read-only tiles are often seen on marketing pages to promote -content. These tiles can have internal calls-to-action (CTAs), such as a -[button](/components/button/usage) or a [link](/components/link/usage). +Base tiles are used to display information to the user, such as features or +services offered. Base tiles are often seen on marketing pages to promote +content or on dashboards that are highly interactive. These tiles can have +internal calls-to-action (CTAs), such as a [button](/components/button/usage) or +a [link](/components/link/usage). - + -![Example image of read-only tiles.](images/tile-usage-1.png) +![Example image of base tiles.](images/tile-usage-1.png) @@ -247,48 +278,365 @@ content. These tiles can have internal calls-to-action (CTAs), such as a Clickable tiles can be used as navigational items, where the entire tile is a clickable state, which redirects the user to a new page. Clickable tiles cannot -contain separate internal CTAs. +contain separate internal CTAs but can contain pictograms, icons, or media such +as illustrations or images. - + -![Example image of clickable tiles.](images/tile-usage-2.png) +![Example image of clickable tiles](images/tile-usage-2.png) ### Selectable -Selectable tiles work like a [radio button](/components/radio-button/usage), -where the entire tile is a click target. Selectable tiles may contain internal -CTAs (like links to docs) if the internal CTA is given its own click target. Selectable tiles work well for presenting options to a user in a structured -manner, such as a set of pricing plans. +manner, such as a set of pricing plans. Selectable tiles may contain internal +CTAs (like links to docs) if the internal CTA is given its own click target. + +Selectable tiles can either have a single select state working like a +[radio button](/components/radio-button/usage), or multi-select state working as +a [checkbox](/components/checkbox/usage). -![Example image of selectable tiles.](images/tile-usage-3.png) +![Selectable radio-button / single select tiles](images/tile-usage-3.png) + +Single select tiles work like radio-buttons + +![Selectable checkbox / multi-select tiles](images/tile-usage-4.png) + +Multi-select tiles work like checkboxes ### Expandable -Expandable tiles are helpful for hiding/showing larger amounts of content to a -user. They can only be stacked in a single column, and cannot live in a row or -horizontal grid. When expanded, tiles push content down the page. Expandable -tiles may contain internal CTAs (like links to docs) if the internal CTA is -given its own click target. +Expandable tiles are helpful for hiding and showing large amounts of content to +a user. +When expanded, tiles push content down the page. They allow the user to +specifically focus on featured content while having access to the rest of the +information. Expandable tiles can contain internal CTAs (like links to docs) if +they are given their own click targets and the click target is reduced to only +the chevron icon. -![Example image of expandable tiles.](images/tile-usage-4.png) +![Example image of expandable tiles/ single select tiles](images/tile-usage-5.gif) + + + + +## Formatting + +### Anatomy + + + + +![Tile anatomy](images/tile-usage-6.png) + + + + +1. **Container**: Includes a title, optional label, and the close icon. + +2. **Content area**: Contains the information and/or controls needed to complete + the modal's task. It can include message text and components. + +### Sizing + +The **width** varies depending on three basic grid modes: wide, narrow, and +condensed. The **height** varies depending on the amount of content placed +within it, but still follows the aspect ratio. + +[Aspect ratios](https://www.carbondesignsystem.com/guidelines/2x-grid/overview/#aspect-ratio) +are written out as a formula of width to height, such as 3:2. It’s important to +remember that while two images can have the same aspect ratio, they can have +varying images sizes. + + + + +![Example image of expandable tiles.](images/tile-usage-7.png) + +Tiles get wider as the browser gets larger + + + + +### Alignment + +Always strive for left alignment whenver possible. Type in tiles should always +be left aligned. Icons or icon buttons can be aligned to either left or right +edge depending on the tiles’ complexity. + +For example: In situations where there are both an icon or pictogram with an +icon button, place the icon or pictorgram in the lower left corner of the tile +and move the icon button (action) to the right corner. + + + + +![Do left align icon, link, or text when it is by itself.](images/tile-usage-8.png) + + + + + +![Do not right align an icon, link, or text when it is by itself.](images/tile-usage-9.png) + + + + + + + + +![Do move icon to the right when there is an icon or pictogram.](images/tile-usage-10.png) + + + + + +![Do move icon to the right when there is text or link.](images/tile-usage-11.png) + + + + +### Placement + +#### Tile groups + +Tile groups are a useful way of aligning tiles that have a strong relationship. +Tile groups flow horizontally left to right usually and have similar +hierarchical importance like navigation or catalog tiles. + + + + +![Example image of how tiles are built on the wide grid.](images/tile-usage-13.png) + +Example image of how tiles are built on the wide grid. + + + +![Example image of how tiles are built on the narrow grid.](images/tile-usage-14.png) + +Example image of how tiles are built on the narrow grid. + + + + + + + +![Example image of how tiles are built on the condensed grid.](images/tile-usage-15.png) + +Example image of how tiles are built on the condensed grid. + + + + +#### Layout + +There are three basic layouts for tiles: **standard**, **vertical masonry**, and +**horizontal masonry**. The standard layout will be the most commonly used +version. + +- Displaying high-level information and metrics on dashboards. +- A vertical masonry grid can vary in height, but is consistent in width. +- A horizontal masonry grid can vary in width. Rows of tiles may vary in height, + but the tiles within a row should be consistent in height. + + + + +![Standard layout for tiles](/images/tile-usage-16.png) + +Standard layout for tiles + + + + + +![An example of the standard layout](/images/tile-usage-17.png) + +An example of the standard layout + + + + + + + +![Vertical masonry layout for tiles](/images/tile-usage-18.png) + +Vertical masonry layout for tiles + + + + + +![An example of the vertical masonry layout](images/tile-usage-19.png) + +An example of the vertical masonry layout + + + + + + + +![Horizonal masonry layout for tiles](/images/tile-usage-20.png) + +Horizonal masonry layout for tiles + + + + + +![An example of the horizonal masonry layout](images/tile-usage-21.png) + +An example of the horizonal masonry layout + + + + +### Elevation + +Tiles reside in the same plane as the background layer—they do not have +elevation. Do not add drop shadows to tiles. Tiles organize essential +information and have the same visual hierarchy as content within the same page. +Modals, popovers, and dialogs do have elevation but are not inherently part of +the user's main workstream and are invoked on screen to reveal secondary +information, actions, or notifications. + +### Call-to-actions + +For **base, selectable, and expandable tiles**, use `$link-01` when icon and +link are paired together or use `$interactive-04` when the icon stands alone. + +For **clickable tiles**, don’t highlight text or icons to avoid them being +confused as links or clickable. + + + + + +![Do use text or icon for clickable tiles if needed.](images/tile-usage-22.png) + + + + +![Do not use link or highlight the icon color for clickable tiles.](images/tile-usage-23.png) + + + + +## Behaviors + +### Interactions + +#### Mouse + +Users can trigger an item by clicking anywhere in any tile container, except +base tiles. + + + + +![Clickable, expandable, and selectable tiles are clickable anywhere within the tile.](images/tile-usage-24.png) + + + Clickable, expandable, and selectable tiles are clickable anywhere within the + tile. + + + + + + + + +![Base tiles are static, except buttons or links .](images/tile-usage-25.png) + +Base tiles are static, except buttons or links . + + + + +Expandable tiles can either be triggered as a whole or only contain internal +CTA's if they are given their own click targets and the tile’s click target is +reduced to only the chevron icon. + + + +**Note:** Clickable targets are currently not available in coding. Teams can +override the code to make smaller click targets while we're updating this in the +future. + + + + + + +![Clickable, expandable, and selectable tiles are clickable anywhere within the tile.](images/tile-usage-26.png) + + + + +#### Keyboard + +Specific keyboard interactions will depend on the type of tile you are using and +what content it contains but all types of tiles can take focus. + +| Key | Interaction | +| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Tab | Move forward through tiles (if tiles themselves are clickable) and interactive elements within the tiles in a logical order | +| Shit + Tab | Move backward through tiles (if tiles themselves are clickable) and interactive elements within the tiles in a logical order | +| Return or Enter | Return or enter will open the tile (if the tile itself is clickable). If the tile is not clickable but has interactive elements, their corresponding actions are performed | +| Space | If the tile is selectable, the space bar will toggle tile selection | + +## Related + +#### Grid + +To learn more about how to build tiles correctly on the grid, see Carbon’s +[2x grid](/guidelines/2x-grid/implementation). + +#### Aspect ratio + +Aspect ratio is important when building tiles and images. For further guidance, +see Carbon’s +[Aspect ratio](https://www.carbondesignsystem.com/guidelines/2x-grid/overview/#aspect-ratio) +and its +[implementation](https://www.carbondesignsystem.com/guidelines/2x-grid/implementation#screen-regions). + +#### Buttons + +When in doubt, use full-span button alignment within tiles. For further +guidance, see Carbon’s [buttons](/components/buttons/usage). + +#### Link + +Link has variants depending on the context. For further guidance, see Carbon’s +[link](/components/buttons/usage). + +## References + +Hagan Rivers, +[Interactions design with cards/tiles](https://medium.com/@hagan.rivers/interaction-design-with-cards-tiles-5a6895aa220d/) +(Medium, 2017) + ## Feedback Help us improve this component by providing feedback, asking questions, and