Talisman LogoTalisman Logo Design System
Browse documentation
Components

Tile

A large selectable card with an icon and a label, for choosing one or several options from a short list.

Stableimport { Tile } from "@repo/ui/tile";Source
selectionMode
variant
<Tile label="Relatório em PDF" selectionMode="checkbox" value="pdf" variant="icon" />

When to use

  • To choose between 2 to 6 options that benefit from an icon, such as the format of a download or a filter.
  • To pick one option (radio) or several (checkbox) when each option needs more presence than a line with a radio.
  • In filters and dialogs where people scan options by shape, which follows Structure you can scan in the manifesto.

When not to use

  • A single on or off setting. Use Switch.
  • A plain list of choices with short labels. Use Radio group or Checkbox.
  • A longer list of options, or one with search. Use Select or Combobox.
  • A card with its own content or actions. Use Card.
  • Options with a long description. The tile is fixed at 160px square. Use Radio card.

Variants

Variant Shows Use for
icon An icon box. The control is hidden but real. Default selection is a checkbox. Most cases. Pair with selectionMode.
checkbox A visible checkbox in the corner. Several options, with no icon.
radio A visible radio in the corner. One option, with no icon.

selectionMode only applies to icon: checkbox (default) or radio. A radio tile must sit inside a Radio group.

States

The tile styles itself from its checked prop. Pass checked always, including with radio, where the group value alone does not color the tile.

Examples

Choose one

Wrap the tiles in a RadioGroup, set selectionMode="radio" and pass checked from the group value.

Choose several

Control checked for each tile and flip it in onClick.

Content

  • The label is a noun, 1 to 2 words: “PDF”, “Planilha”, “Vencidas”.
  • Add description only when the label alone is ambiguous. It shares the same 160px square.
  • Use the icon that best matches the object, not a generic one.
  • Keep every tile in a group the same size.

Do and don’t

DoGroup tiles that answer the same question, with a short label each.
Don'tDon't use one lone tile as a toggle. It reads as a button and hides its state.

Accessibility

  • The whole tile is a label, so clicking anywhere selects it. It connects to the control through htmlFor, which is the value.
  • In checkbox and icon mode the control is a Radix Checkbox (role="checkbox", aria-checked). In radio mode it is a Radix Radio Group item (role="radio"), so arrow keys move inside the group and Tab enters it once.
  • In the icon variant the control is visually hidden (sr-only) but stays in the tab order, so keyboard and screen reader users reach it.
  • Give the group a name: aria-label on the RadioGroup, or a role="group" with a label for several tiles.
  • disabled sets aria-disabled on the label and removes pointer events.
  • The visible focus on icon tiles is missing (see Known issues).

Code

import { RadioGroup } from "@repo/ui/radio-group";
import { Tile } from "@repo/ui/tile";
import { FileText } from "lucide-react";

<RadioGroup
  aria-label="Formato do download"
  onValueChange={setFormat}
  value={format}
>
  <Tile
    checked={format === "pdf"}
    icon={FileText}
    label="PDF"
    selectionMode="radio"
    value="pdf"
    variant="icon"
  />
</RadioGroup>;

Props

Tile
PropTypeDefaultDescription
checkedboolean—Selected state. The tile only styles itself from this prop, so always pass it, also with `radio`
classNamestring—Layout classes, for example to change the fixed 160px size
descriptionstring—Secondary text under the label
disabledbooleanfalseBlocks interaction
iconElementType—Lucide icon shown in the `icon` variant
iconClassNamestring—Classes for the icon box
labelstring—Visible name of the option. Required
onClickMouseEventHandler—Click handler, forwarded to the checkbox
selectionMode"checkbox" | "radio"checkboxWith `variant="icon"`, picks the hidden control: a checkbox or a radio
valuestring—Option value. Also used as the control id, so keep it unique on the page
variant"checkbox" | "icon" | "radio"—Which control the tile shows

Known issues

Issue Effect
In the icon variant the control is sr-only and the label has no focus-visible or has-[:focus-visible] style. Keyboard users get no visible focus on the tile, which fails WCAG 2.4.7.
The checked background, the hover background and the icon box (--bg-brand at 50%) are set with inline style and a JS hover state. A translucent fill, and a style that CSS cannot override or force for testing.
Disabled uses opacity-50. Dims the label and icon together, below text contrast. It does not use the disabled tokens.
The visual state reads only checked; radio does not forward it to the group item. An uncontrolled tile never looks selected. You must pass checked in sync with the group value.
onClick reaches only the checkbox. In radio mode it is ignored. Handle the change on RadioGroup.
The size is fixed (size-40) and the value is the DOM id. Wide labels wrap or overflow, and two tiles with the same value on a page break the label link.
Edit this page on GitHub