Icon Tile
FreeOne icon on a tint surface without a rim: the leading mark of a list row, a settings section or a metric. Nine tones, five sizes, square or round.
npx wunderui-cli add icon-tilePlayground
Installation
npx wunderui-cli add icon-tileWrites the source into your project with its dependencies and, on first use, the styles - see Installation.
Then import what you need:
import {
IconTile,
ICON_TILE_SIZES,
ICON_TILE_TONES,
} from "@/components/wunderui/icon-tile"
import type {
IconTileProps,
IconTileSize,
IconTileTone,
} from "@/components/wunderui/icon-tile"Then use it:
import { Wallet } from "lucide-react"
import { IconTile } from "@wunderui/react"
export function Payouts() {
return (
<div className="flex items-center gap-3">
<IconTile icon={<Wallet />} tone="green" size={36} />
<span className="text-sm font-medium">Payouts</span>
</div>
)
}Expected result: You see a 36 px light green tile with a green wallet icon beside the word Payouts.
When to use
Use Icon Tile for
- The leading mark of a list row or settings section
- A small marker beside the label of a metric
- A category colour that carries through a list
Use something else for
- Icon Button for an icon that runs an action
- Avatar for a person or a team
- Brand Logo for the logo of a product or service
Tone
The tile is the tint of one hue and the icon takes the tint text colour of the same hue, so it reads in light and dark mode. `neutral` (the default) is the grey tint. There is no rim.
Size
Five sizes with the icon sized for them: 24 px holds a 14 px icon, 32 px a 16 px icon (the default), 36 px an 18 px icon, 40 px a 20 px icon and 48 px a 24 px icon, for the head of a sign-in or empty screen.
Shape
Square tiles have 8 px corners, 4 px at 24 px and 16 px at 48 px. `circle` makes the tile round, for people-like or status marks.
Behavior and motion
What the tile does with its tone, size and label. It is display only: no hover, focus or keyboard behaviour.
- Decorative by default
- Without label the tile has aria-hidden, so a screen reader reads only the text beside it. With label it is an image with that name.
- Icons
- Pass an element such as <Wallet /> or the component Wallet itself. Every svg inside is sized by the tile; the colour comes from the tone through currentColor.
- Tone in light and dark
- Each tone is a tint surface and its tint text colour, both theme tokens, so the pair keeps its contrast in dark mode. neutral is the grey tint.
- Corners
- Square tiles have 8 px corners, 24 px tiles 4 px and 48 px tiles 16 px, so a tile never looks pinched next to the rows it sits in. circle is fully round at every size.
- Motion and reduced motion
- Nothing is animated, so there is nothing to reduce under reduced motion.
Anatomy
The parts of a tile, numbered in the figure, drawn larger than real size.
- 1data-slot="icon-tile"
A span filled with the tint of its tone, 24 to 48 px, with 8 px corners (4 px at 24 px, 16 px at 48 px) or round. No rim. Hidden from screen readers unless it has a label.
- 2
The icon you pass, sized by the tile (14, 16, 18, 20 or 24 px) and drawn in the tint text colour of the same hue.
Best practices
- Do
Give one meaning one tone across a screen, such as green for money and red for risk, and keep neutral for the rest.
- Do
Keep one size per list, so the labels beside the tiles share one edge.
- Do
Pass a label only when the tile is the only thing that says what it means. Beside a title it stays decorative.
- Don’t
Don't add a border or a second colour to the icon. The tile is a plain tint and the icon one colour.
- Don’t
Don't make the tile a button. Wrap the whole row in the button, or use Icon Button for an icon action.
- Don’t
Don't use it for a person or a brand. Avatar and Brand Logo are made for those.
API reference
IconTile renders a span and passes every other span attribute on, so an id, a data attribute or a className can be set.
A span filled with the tint of its tone, 24 to 48 px, with 8 px corners (4 px at 24 px, 16 px at 48 px) or round. No rim. Hidden from screen readers unless it has a label.
| Prop | Type | Default | Description |
|---|---|---|---|
| icon required | ReactNode | ElementType | — | The icon: an element () or an icon component (). The tile sizes and colours it. |
| tone | "indigo" | "blue" | "purple" | "pink" | "red" | "orange" | "yellow" | "green" | "neutral" | "neutral" | The hue: (default), , , , , , , or (the list is ). |
| size | 36 | 24 | 32 | 40 | 48 | 32 | The tile in px: , (default), , or , with a 14, 16, 18, 20 or 24 px icon. |
| shape | "square" | "circle" | "square" | (default, rounded corners) or . |
| label | string | — | The accessible name. Without it the tile is decorative and hidden from screen readers. |
Notes for AI
Give your coding assistant the Markdown reference instead of screenshots.
get_component("icon-tile")npx wunderui-cli add icon-tileThe full library index for assistants is at /llms.txt.
Related components
- NLNora LindgrenWunderUI Pro, one-time$299.00Today
- DODaniel OkaforWunderUI Core, one-time$199.00Yesterday
- PRPriya RamanWunderUI Pro, one-time$299.00Nov 4
Data & Tables9 stylesProList ItemOne list row: an icon tile, avatar, logo, flag, checkbox or date tile on the left, title and description in the middle, a value, badge, trend, button, switch or menu on the right. Comfortable or compact, with default, hover, selected and disabled states.