title |
---|
ion-back-button |
import Props from '@ionic-internal/component-api/v8/back-button/props.md'; import Events from '@ionic-internal/component-api/v8/back-button/events.md'; import Methods from '@ionic-internal/component-api/v8/back-button/methods.md'; import Parts from '@ionic-internal/component-api/v8/back-button/parts.md'; import CustomProps from '@ionic-internal/component-api/v8/back-button/custom-props.mdx'; import Slots from '@ionic-internal/component-api/v8/back-button/slots.md';
<title>ion-back-button: Custom Menu Back Button for Applications</title>import EncapsulationPill from '@components/page/api/EncapsulationPill';
The back button navigates back in the app's history when clicked. It is only displayed when there is history in the navigation stack, unless defaultHref
is set. The back button displays different text and icon based on the mode, but this can be customized.
import Basic from '@site/static/usage/v8/back-button/basic/index.md';
By default, the back button will display the text "Back"
with a "chevron-back"
icon on ios
, and an "arrow-back-sharp"
icon on md
. This can be customized per back button component by setting the icon
or text
properties. Alternatively, it can be set globally using the backButtonIcon
or backButtonText
properties in the global config. See the Config docs for more information.
import Custom from '@site/static/usage/v8/back-button/custom/index.md';
Occasionally an app may need to show the back button and navigate back when there is no history. This can be done by setting the defaultHref
on the back button to a path. In order to use defaultHref
, the app must contain a router with paths set.