ZUI

Search documentation

Find a page or a heading.

Icon media

A small square that holds one glyph, its background and its glyph tinted through the caller's className, announced as an image when it is given a label.

Installation

bash

The CLI writes components/general/icon-media.tsx and installs Icon, Text and Utils.

Usage

tsx
tsx

It carries no meaning of its own, so one serves a model ability, a generation type or any icon the caller picks. Give it an aria-label, or name the Tooltip trigger around it, which a press opens. For a field's own text label, use Icon label instead.

API reference

IconMedia

Takes every prop of React Native's View. The design system ships no tint for it; the caller's className supplies the colours. Its text classes, such as text-muted-foreground, go to the Icon and Text inside it, since a View draws no text colour, and the rest style the square. An Icon inside it with no size-* class of its own is drawn at size-3. With an aria-label it is one element for a screen reader, announced as an image.

Differences from the web

  • The web sizes any child svg; the native square sizes an Icon, which takes the size through its container.
  • The web tooltip opens on hover; on a device the tooltip trigger around it opens on a press.