Theme studio

Design a theme, preview it live, then export it. Saved in this browser.

Quick picks #10b981
Generated scale
50100200300400500600700800900
Some text is below AA

ImageTile

  • Stable
  • WCAG 2.2 evidence
  • RTL

A square picture in a gallery or picker, with overlay actions on hover and a selected state. The tile itself is one button: a React Aria ToggleButton or a Button when onPress is set. Its name is the picture's alt (or aria-label). The overlay actions are sibling buttons after it in the tab order, each described by the tile's name. Keyboard: Tab reaches the tile and then its actions; Enter and Space press them; keyboard focus shows the focus ring and reveals the actions (WCAG 2.1.1, 2.4.7, 4.1.2). Pointer: hover reveals the actions over a 45 % media/bg scrim; Escape hides that hover overlay again (1.4.13); on touch devices the actions are always visible. Targets: the tile, and 36 px action buttons (2.5.8). Hover, focus and selection are driven by React Aria (data-hovered, data-focus-visible, data-selected, data-actions-visible on the root). Consumer duties: meaningful alt, short translated action labels, confirming destructive actions (Delete), and a visible summary of a multiple selection where it matters.

import { ImageTile } from "@nexera-ui/react";
Loading example…
5
examples
13
props
3
live controls
1
platform
11
WCAG criteria
2
blocks use it

Try every prop. Copy the code.

Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.

Loading…
isDisabled
isSelected
defaultSelected
Generated code
import { ImageTile } from "@nexera-ui/react";

<ImageTile />

Examples 4

The same examples as Storybook, rendered live. Open Code to copy one.

Selectable gallery

A picker: tiles in a wrapping grid, selection kept by the parent (controlled), with a visible summary.

Loading example…

Pressable

With onPress the tile is a plain button (for example to open a preview); no selected state.

Loading example…

Disabled

Disabled: dimmed, and the tile and its actions leave the tab order.

Loading example…

Unavailable

Without a src, or when it fails, the tile shows the "Image unavailable" frame or the fallback slot.

Loading example…

Props 13

Press "Try it" on a card to load that prop into the playground.

13 props shown

srcNexera
string | null

Image URL (see Image). Without one, or when it fails, the tile shows fallback or the "Image unavailable" frame.

Default –
alt*Nexera
string

Text alternative of the picture, required (WCAG 1.1.1). It also names the tile's button, so describe the picture ("Team at the March offsite"); for a picture without a useful description, pass "" and set aria-label.

Default –
fallbackNexera
ReactNode

The Figma Photo placeholder slot: shown without a src or when the picture fails (see Image).

Default –
errorLabelNexera
string

Text of the default error frame. Translate it.

Default "Image unavailable"
actionsNexera
readonly ImageTileAction[]

Overlay actions: round buttons over a media/bg scrim. They appear while the tile is hovered or keyboard focus is on the tile or an action, are always shown on touch devices, and stay reachable by Tab and screen readers. Escape hides the hover overlay.

Default –
isDisabledNexera
boolean

Disables the tile and its actions.

Default false
aria-labelNexera
string

Accessible name of the tile's button when alt does not name it well. Translate it.

Default –
classNameNexera
string

Extra classes for the root, merged last so they win over the defaults.

Default –
styleNexera
CSSProperties

Inline style for the root.

Default –
isSelectedNexera
boolean

Whether the tile is selected. Pair it with onChange. Only on a selectable tile (without onPress).

Default –
defaultSelectedNexera
boolean

Whether the tile is selected at first render (uncontrolled). Only on a selectable tile (without onPress).

Default false
onChangeNexera
(isSelected: boolean) => void

Called with the new selection when the tile is pressed. Only on a selectable tile (without onPress).

Default –
onPressNexera
(event: PressEvent) => void

Use onChange on a selectable tile. Called when the tile is pressed (pointer, Enter or Space). The tile is a plain button: no aria-pressed.

Default –

* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.

Accessible by default.

Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.

WCAG 2.2 evidence

8 direct · 3 supporting
  • 1.1.1Non-text ContentLevel A · tested directly
  • 1.3.1Info and RelationshipsLevel A · tested directly
  • 1.3.2Meaningful SequenceLevel A · supporting test
  • 1.4.1Use of ColorLevel A · tested directly
  • 1.4.11Non-text ContrastLevel AA · supporting test
  • 1.4.13Content on Hover or FocusLevel AA · tested directly
  • 2.1.1KeyboardLevel A · tested directly
  • 2.4.3Focus OrderLevel A · tested directly
  • 2.4.7Focus VisibleLevel AA · tested directly
  • 2.5.8Target Size (Minimum)Level AA · supporting test
  • 4.1.2Name, Role, ValueLevel A · tested directly

Fits any width.

Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.

0 px · drag the corner

Styling hooks

Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.

  • data-disabled
  • data-hovered
  • data-pressed
Usage
<ImageTile className="data-disabled:opacity-90 shadow-sm" />

Used in blocks

Related components