Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
    • BackButton
    • Button
    • HighlightButton
    • IconButton
    • SemanticButton
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Buttons & actions
  • BackButton

BackButton

Takes the user back a step. Pick the icon variant that matches the context: an arrow to go back, a cross to close.

Health
Component health
Source
View on Github
Design
View Figma
Playground
No Example
Accessibility

compliant

Platform
Universal
  • Overview
  • Props
  • Figma

Variants​

The BackButton component supports several icon variants to match different navigation and action contexts:

  • arrowLeft (default) - Use for backward navigation, returning to previous screens or pages. This is the most common variant for back buttons.
  • arrowRight - Use for forward navigation, moving to the next step or page in a sequence.
  • cross - Use for closing dialogs, modals, or dismissing overlays.
  • arrowDropdown - Use to indicate an expandable dropdown menu or collapsible section.
  • arrowDropup - Use to indicate a collapsible section that can be collapsed or a dropdown that is currently expanded.
  • closeAlt - Alternative close icon variant, use when you need a different visual style for closing actions.
  • journal - Use for journal-related actions or accessing journal/log views.
  • refresh - Use for refresh or reload actions, typically to update content or reload data.

Label​

As a link​

If you provide the href prop, the button will be rendered as a link (web only). In that case, the onPress prop becomes optional. If your link is not in the same app, you can pass the full url. It is useful when, for example, your flow is integrated in the dashboard and the website.

Client side navigation example:

External link example:

Accessibility​

Be sure to provide either a visual label or an aria-label prop to ensure the button is accessible to screen readers.

To read more about the accessible name, check the Accessible Names documentation.

Playground​

Loading...
tip
This component is universal, its usage is the same in murray and murray/mobile.

BackButton props

NameTypeDefault ValueDescriptionUsage count
disabledbooleanundefinedIndicated disabled state
externalPseudoState"hovered""pressed"undefinedExternally controlled pseudo state for hover/press effects. Use this when the button is wrapped in a component that prevents normal event handling (e.g., Popover triggers with asChild). @internal - Primarily for internal Murray use
hasDropdownArrowbooleanundefinedAdds an arrow on the right. Use when the button triggers a dropdown or similar
hitSlopnumberInsetsnullundefinedDefines how far your touch can start away from the button on mobile @platform mobile
hrefstringundefinedIf provided, renders as a Link component (react-router-dom) on web
isActivebooleanundefinedSets the button in a pressed state.
labelstringundefined
onMouseEnterundefinedMouseEventHandler<HTMLDivElement>
onMouseLeaveundefinedMouseEventHandler<HTMLDivElement>
onPress
2 possibilitiesundefined | null | (event: GestureResponderEvent) => void(e: MouseEvent<HTMLAnchorElement, MouseEvent>) => void
When href is provided, onPress receives a React.MouseEvent<HTMLAnchorElement>
onPressIn
3 possibilities((event: GestureResponderEvent) => void)nullundefined
onPressOut
3 possibilities((event: GestureResponderEvent) => void)nullundefined
pressedScalenumberundefinedScale multiplier applied on press (e.g., 1.1 for 110% scale). When provided, button will animate scale on press.
progressbooleanundefinedDetermines whether the Loader component should be displayed over the button
successbooleanundefinedDetermines whether a success icon should be displayed over the button
sxPositionPropsundefined
titlestringundefinedTooltip shown on hover (web). Defaults to `aria-label`, so sighted users see what screen readers announce.
type"button""submit""reset"undefined
variantBackButtonVariantundefinedarrowLeftControls which icon is displayed. `arrowLeft` by default

Undocumented props

NameTypeDefault ValueDescriptionUsage count
data-testidany
refany
testIDany

Style API​

Use sx for one-off adjustments. It accepts these style keys:

alignSelfanimationaspectRatiobottomcursordisplayendflexflexBasisflexGrowflexShrinkheightinsetinsetInlineinsetInlineEndinsetInlineStartleftmarginmarginBottommarginHorizontalmarginInlinemarginInlineEndmarginInlineStartmarginLeftmarginRightmarginTopmarginVerticalmatrixmaxHeightmaxWidthminHeightminWidthopacityperspectivepositionrightrotaterotateXrotateYrotateZscalescaleXscaleYskewXskewYstarttoptransformtransformOriginwidthxyzIndex

Each can be overridden per breakpoint with:

$lg$ltLg$ltMd$ltSm$ltVs$ltXl$ltXxl$md$sm$vs$xl$xs$xxl
Edit this page
Previous
All components
Next
Button
  • Variants
  • Label
  • As a link
  • Accessibility
  • Playground