Icon Tile
The colored rounded-square icons used in System Settings and other lists.
@cupertinoui/icon-tileRegistry JSON "use client"
import {
BellIcon,
BluetoothIcon,
HandIcon,
HourglassIcon,
MoonIcon,
SettingsIcon,
Volume2Icon,
WifiIcon,
} from "lucide-react"
import { IconTile } from "@/components/ui/icon-tile"
const tiles = [
{ label: "Wi-Fi", icon: WifiIcon, color: "blue" },
{ label: "Bluetooth", icon: BluetoothIcon, color: "blue" },
{ label: "General", icon: SettingsIcon, color: "gray" },
{ label: "Notifications", icon: BellIcon, color: "red" },
{ label: "Sound", icon: Volume2Icon, color: "pink" },
{ label: "Focus", icon: MoonIcon, color: "indigo" },
{ label: "Screen Time", icon: HourglassIcon, color: "indigo" },
{ label: "Privacy & Security", icon: HandIcon, color: "blue" },
] as const
export default function IconTileDemo() {
return (
<div className="grid grid-cols-2 gap-x-8 gap-y-3">
{tiles.map((tile) => (
<div key={tile.label} className="flex items-center gap-2 text-mac-body">
<IconTile color={tile.color}>
<tile.icon strokeWidth={2} />
</IconTile>
{tile.label}
</div>
))}
</div>
)
}Installation
pnpm dlx shadcn@latest add @cupertinoui/icon-tileThe first install also adds the macOS theme. See Installation to set up the registry.
Usage
import { IconTile } from "@/components/ui/icon-tile"
<IconTile color="blue">
<WifiIcon />
</IconTile>Examples
Sizes
"use client"
import { CloudIcon } from "lucide-react"
import { IconTile } from "@/components/ui/icon-tile"
export default function IconTileSizes() {
return (
<div className="flex items-end gap-4">
<IconTile size="sm" color="blue">
<CloudIcon strokeWidth={2.25} />
</IconTile>
<IconTile color="blue">
<CloudIcon strokeWidth={2} />
</IconTile>
<IconTile size="lg" color="blue">
<CloudIcon strokeWidth={2} />
</IconTile>
</div>
)
}API Reference
Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.
IconTile
| Prop | Type | Description |
|---|---|---|
color | "blue" | "gray" | "graphite" | "green" | "indigo" | "orange" | "pink" | "purple" | "red" | "teal" | "yellow" | "black" | "white"Default: "blue" | The tile color. |
size | "sm" | "default" | "lg"Default: "default" | 16, 20 or 32pt. |
className | string | Extra classes, merged with the component's own. |