Skip to content

Expand on Hover

Pro

A row of photo strips. The one under the pointer grows to show its whole photo and title. On a phone the strips stack, and a tap opens one.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 10, 2026 · Pro license

Playground

Loading the preview

Props

Needs your Pro API key in GELATIN_UI_PRO_TOKEN. Set it up

Pro itemAPI key required

Expand on Hover needs a Pro API key

Try the live preview for free. With Pro, the add command above puts the source in your project.

Files it adds
21
More Pro items, one API key
+327
Your coding agent runs it
1 cmd

$79$129once, for life

Already have Pro? Sign in to set up your API key.

Give each item a value, a picture, a label, and the open text.

The sample also uses Image. One command adds them with this item:

trip-days.tsx

ExpandOnHover

<div>
PropTypeDefaultDescription
rounded"default""full""default"
orientation"auto""horizontal""vertical""auto"auto (the default): a row while each closed strip is at least 44px wide, else a column of bands, as on a phone (a tap opens one band, which grows down). horizontal and vertical keep one layout. A column is at least 44px per closed band tall, whatever its height class.
valuestring | null—The open item (controlled). null: no item is open, and all items share the row evenly.
defaultValuestring | nullnullThe open item at first (uncontrolled). Default null.
onValueChange—Called when hover, focus, or a tap opens another item, with the Base UI change details (reason "none": the hover intent opens it after its rest, not on an event of its own).
openSizenumber5How many closed items the open item is as wide (or tall) as. Default 5.
disabledbooleanfalseNo item opens; the open item stays open.
From Base UIUseRenderBase UI docs
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ExpandOnHoverItem

<div>
PropTypeDefaultDescription
valueRequiredstring—The value that names this item in value, defaultValue, and onValueChange.
disabledbooleanfalseThis item never opens and leaves the Tab order.
From Base UIUseRenderBase UI docs
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ExpandOnHoverMedia

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ExpandOnHoverLabel

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ExpandOnHoverContent

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.
  • Give each ExpandOnHoverItem a value, and the root a defaultValue, so one item is open at rest.
  • Put the picture in ExpandOnHoverMedia, the closed title in ExpandOnHoverLabel, and the open text in ExpandOnHoverContent.
  • Render a link with render={<a href="…" />} for an item that goes somewhere.
  • Leave orientation on "auto": when a closed strip would be under 44px, as on a phone, the strips stack into bands, and a tap opens one.
  • For panels of text that open and close, use Accordion.
  • For many photos that a person swipes through, use Carousel.
TabMoves to the next strip and opens it.
EnterorSpaceOpens the focused strip. On a link strip, Enter follows the link.

Each item is one button (or the link you render), named by its Label, with aria-expanded on the open state.

The open text describes the open item. Screen readers and the Tab key skip it while the item is closed.

Give a Media-only item an aria-label.

Open
glide · spring (stiffness 700, damping 53), the open strip grows as the others shrink, with no overshoot
Text
glide · the label fades out in the first 30% of the open; the content fades in and rises 8px in the second half
  1. AddedExpand on Hover.
Open the release