Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Pressable

The Pressable component wraps content to make it interactive and pressable. Use it when you need more styling control than Button or Link provide, such as custom backgrounds, padding, or borders around your pressable content.

Pressable shares the same styling properties as View but adds pressable behavior, so you can execute logic in response to user interaction.

Support
Targets (25)

Configure the following properties on the Pressable component.

Anchor to accessibilityLabel
accessibilityLabel
string

A label that describes the purpose or content of the element for users of assistive technologies such as screen readers. When set, it provides additional context beyond the visible content.

Anchor to accessibilityRole
accessibilityRole
Default: 'button'

The role of the button that will be rendered.

  • 'button': Renders a regular button.
  • 'submit': Renders a button that submits a form.
Anchor to activateAction
activateAction
'auto' | 'copy'
Default: 'auto' - a default action for the target component.

Sets the action the activateTarget should take when this component is activated.

Supported actions by component:

ComponentSupported ActionsDefault ('auto')
ClipboardItem'copy''copy'
Anchor to activateTarget
activateTarget
string

The ID of the component to control when this component is activated. Pair with the activateAction property to specify what action to perform on the target component.

Anchor to background
background
<>
Default: 'transparent'

The background color of the element, set using a design-system keyword.

Anchor to blockAlignment
blockAlignment
< Extract<, 'start' | 'center' | 'end'> >

Position children along the cross axis

Anchor to border
border
<<>>

The border style of the element. Accepts a single value for all four edges, or a shorthand tuple for per-edge control:

  • 'base': Applies base to all edges.
  • ['base', 'none']: Block edges get base, inline edges get none.
  • ['base', 'none', 'dotted', 'base']: Values apply to block-start, inline-end, block-end, and inline-start respectively.
Anchor to borderWidth
borderWidth
< <> >

The border width of the element. Accepts a single value for all four edges, or a shorthand tuple for per-edge control:

  • 'base': Applies base to all edges.
  • ['base', 'medium']: Block edges get base, inline edges get medium.
  • ['base', 'medium', 'medium', 'base']: Values apply to block-start, inline-end, block-end, and inline-start respectively.
Anchor to cornerRadius
cornerRadius
< <> >

The corner radius of the element. Accepts a single value for all four corners, or a shorthand tuple for per-corner control using logical (writing-mode-aware) corners:

  • 'base': All four corners get base radius.
  • ['base', 'none']: StartStart/EndEnd get base, StartEnd/EndStart get none. In left-to-right mode, StartStart and EndEnd are the top-left and bottom-right corners.
  • ['base', 'none', 'small', 'base']: Values apply to StartStart, StartEnd, EndEnd, and EndStart respectively.

A borderRadius alias is available. When both are set, cornerRadius takes precedence.

Anchor to disabled
disabled
boolean

Whether the element is disabled, preventing it from being activated or receiving focus.

Anchor to display
display
<>
Default: 'auto'

Changes the display of the component.

inline the component starts on the same line as preceding inline content and allows subsequent content to continue on the same line.

block the component starts on its own new line and fills its parent.

auto resets the component to its initial value. The actual value depends on the component and context.

none hides the component and removes it from the accessibility tree, making it invisible to screen readers.

Learn more about the display property.

string

A unique identifier for the component. Use this to target the component in scripts or stylesheets, or to distinguish it from other instances of the same component.

Anchor to inlineAlignment
inlineAlignment
<>

Position children along the main axis

Anchor to loading
loading
boolean

Whether the element is in a loading state. Unlike Button, no loading indicator is rendered.

Anchor to maxBlockSize
maxBlockSize
< number | `${number}%` | 'fill' >

The maximum block size (maximum height in horizontal writing modes). The element won't grow taller than this value even if its content is longer.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's block size.
  • 'fill': Takes all the available space.

Learn more about the max-block-size property.

Anchor to maxInlineSize
maxInlineSize
< number | `${number}%` | 'fill' >

The maximum inline size (maximum width in horizontal writing modes). The element won't grow wider than this value.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's inline size.
  • 'fill': Takes all the available space.

Learn more about the max-inline-size property.

Anchor to minBlockSize
minBlockSize
< number | `${number}%` | 'fill' >

The minimum block size (minimum height in horizontal writing modes). The element won't shrink smaller than this value even if its content is shorter.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's block size.
  • 'fill': Takes all the available space.

Learn more about the min-block-size property.

Anchor to minInlineSize
minInlineSize
< number | `${number}%` | 'fill' >

The minimum inline size (minimum width in horizontal writing modes). The element won't shrink narrower than this value.

  • number: The size in pixels.
  • `${number}%`: The size as a percentage of the parent container's inline size.
  • 'fill': Takes all the available space.

Learn more about the min-inline-size property.

Anchor to onBlur
onBlur
() => void

A callback fired when the element loses focus.

Anchor to onFocus
onFocus
() => void

A callback fired when the element receives focus.

Anchor to onPointerDown
onPointerDown
() => void

A callback fired when a pointing device button is pressed while the pointer is inside the element.

Anchor to onPointerEnter
onPointerEnter
() => void

A callback fired when the pointing device enters the element.

Anchor to onPointerLeave
onPointerLeave
() => void

A callback fired when the pointing device leaves the element.

Anchor to onPointerUp
onPointerUp
() => void

A callback fired when a pointing device button is released while the pointer is inside the element.

Anchor to onPress
onPress
() => void

A callback fired when the element is activated by the user.

Anchor to opacity
opacity

Sets the opacity of the View. The opacity will be applied to the background as well as all the children of the View. Use carefully as this could decrease the contrast ratio between the background and foreground elements, resulting in unreadable and inaccessible text.

Anchor to overflow
overflow
'hidden' | 'visible'
Default: 'visible'

Sets the overflow behavior of the element.

hidden: clips the content when it is larger than the element’s container. The element will not be scrollable and the users will not be able to access the clipped content by dragging or using a scroll wheel.

visible: the content that extends beyond the element’s container is visible.

Anchor to overlay
overlay
RemoteFragment

An overlay component to render when the user interacts with the component, such as a popover, modal, or tooltip.

Anchor to padding
padding
<<>>

The padding on all edges of the element, using a shorthand syntax. You can specify one, two, or four values following the CSS shorthand convention.

  • T: A single value applied uniformly to all edges.
  • [T, T]: The first value applies to block-start and block-end, the second to inline-start and inline-end.
  • [T, T, T, T]: Values apply to block-start, inline-end, block-end, and inline-start respectively.
string

The URL to navigate to when the element is activated. When set, the component renders as an anchor element.

Anchor to toggles
toggles
string

The ID of the component whose visibility will be toggled when this component is activated. Use this to show or hide related content like a disclosure panel.

Anchor to borderRadius
borderRadius
< <> >

The corner radius of the element. Accepts a single value for all four corners, or a shorthand tuple for per-corner control:

  • 'base': All four corners get base radius.
  • ['base', 'none']: StartStart/EndEnd get base, StartEnd/EndStart get none.
  • ['base', 'none', 'small', 'base']: Values apply to StartStart, StartEnd, EndEnd, and EndStart respectively.
Deprecated

Use cornerRadius instead.


Anchor to Make a custom interactive areaMake a custom interactive area

Create a custom interactive area with borders and padding. This example shows a Pressable with custom styling containing text and an icon.

Make a custom interactive area

A pressable container with a Details label and chevron icon

Make a custom interactive area

import {
reactExtension,
Icon,
InlineLayout,
Pressable,
Text,
} from '@shopify/ui-extensions-react/customer-account';

export default reactExtension(
'customer-account.page.render',
() => <Extension />,
);

function Extension() {
return (
<Pressable
border="base"
cornerRadius="base"
padding="base"
>
<InlineLayout columns={['fill', 'auto']}>
<Text>Details</Text>
<Icon source="chevronDown" size="small" />
</InlineLayout>
</Pressable>
);
}
import {
extension,
Icon,
InlineLayout,
Pressable,
Text,
} from '@shopify/ui-extensions/customer-account';

export default extension('customer-account.page.render', (root) => {
const pressable = root.createComponent(
Pressable,
{
border: 'base',
cornerRadius: 'base',
padding: 'base',
onPress: () => console.log('onPress event'),
},
[
root.createComponent(InlineLayout, {columns: ['fill', 'auto']}, [
root.createComponent(Text, {}, 'Details'),
root.createComponent(Icon, {source: 'chevronDown', size: 'small'}),
]),
],
);

root.appendChild(pressable);
});

  • Provide accessibility labels: Set accessibilityLabel when the wrapped content doesn't include visible text that describes the action.
  • Use for custom layouts only: If a standard button or link meets your needs, prefer those components for consistent styling and accessibility.
  • Avoid nesting interactive elements: Don't place buttons or links inside a pressable area, as this creates conflicting interaction targets.

  • No variant or tone props are available. All visual styling must be applied manually through border, background, and padding props.

Was this page helpful?