---
title: WaffleGrid
---

import LibraryInfo from '@theme/LibraryInfo'
import { Feedback, TokensTable, PropsTable } from '../../src/components'
import { WaffleGrid } from '@telus-uds/components-web'
import { WaffleGrid as WebDocs } from 'docs/@telus-uds/components-web'
import AvailableOnWebOnly from '../../partials/_platform-considerations-web-only.mdx'
import NoStylisticVariants from '../../partials/_variants-none.mdx'

# WaffleGrid

<LibraryInfo
  packageType="Web Component"
  figmaLink="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2F4zJn2Qn6uXOqPP1GVDipy6%2F%25F0%259F%258D%2580-Allium-Components%3Fnode-id%3D7640%253A146557"
/>

```jsx live
<WaffleGrid
  items={[1, 2, 3, 4, 5, 6].map((_, i) => ({
    image: '/universal-design-system/img/pigs-allium-lo.png',
    imageAltText: 'The image alt text',
    href: `//telus.com?item=${i}`,
    text: 'TELUS'
  }))}
/>
```

## Introduction

A WaffleGrid is used to show items in a waffle-like manner with borders surrounding the element.

[Follow the appropriate instructions](importing-components) to add this component in to your app.

## Guidance

:::info
This component is still in beta, it may change in the future.
:::

Use when you want an image and a text displayed under the image, as a link, to have a separating border either on the right or left and/or under the image/text

- Desktop/large view will have **6** items in a row
- Tablet/medium view will have **3** items in a row
- Mobile/small view will have **2** items in a row

### Using custom image content

Note that you can use custom image components by passing arbitrary JSX (e.g. NextJS `Image`) in the item `image` property instead of a string URL:

```jsx live
<WaffleGrid
  items={[1, 2, 3, 4, 5, 6].map((_, i) => ({
    image: (
      <OptimizeImage
        contentfulAssetUrl="/universal-design-system/img/pigs-allium-lo.png"
        alt="guinea pig"
      />
    ),
    imageAltText: 'The image alt text',
    href: `//telus.com?item=${i}`,
    text: 'TELUS'
  }))}
/>
```

### Future iterations

- Consider what should happen given a very long text to display
- Consider accepting "node" properties to be flexible to display more than just a link

### Accessibility

Currently this component does not apply any semantic roles to the members or container of the grid.

### Platform considerations

<AvailableOnWebOnly />

## Props

<PropsTable web={WebDocs} />

## Tokens

<TokensTable web={WebDocs} component="WaffleGrid" />

## Variants

<NoStylisticVariants />

## Feedback

<Feedback component="WaffleGrid" />
