Skip to Content
RevealTile

RevealTile

A native toggle button that reveals a second presentational face.

Interactive example React 19 · local alpha

Ready

Usage

The example assumes the stylesheet and a Theme are already present.

import { RevealTile } from "@pane-ui/react"; <RevealTile label="forecast" front="24°" back="Clear skies" />;

API

Prop / exportType / defaultPurpose
label, front, backReactNode; requiredCaption and the two presentational faces.
revealedboolean; optionalControlled face state.
defaultRevealedboolean; default falseInitial uncontrolled state.
onRevealedChange(revealed: boolean) => voidRequests the next state.
size, accentTile appearance; defaults "small", "accent"Shared tile geometry and treatment.
Native props / refbutton except children / HTMLButtonElementDefault type is button; disabled and form ownership are native.

Behavior and composition

Enter and Space toggle the button. The caption provides the accessible name unless you override the name with ARIA; the active face supplies a description. aria-pressed reflects the revealed state. The inactive face is hidden from accessibility APIs.

Faces must contain only presentational content. Do not place links, buttons or fields inside them. In controlled mode, the displayed face changes only when you update revealed. The consumer onClick runs first; preventDefault() cancels toggling and the state callback. Use disabled when activation is unavailable.

Last updated on