29 captures
18 Aug 2019 - 08 Sep 2024
Dec JAN Feb
22
2021 2022 2023
success
fail

About this capture

COLLECTED BY

Collection: Common Crawl

Web crawl data from Common Crawl.
TIMESTAMPS

The Wayback Machine - http://web.archive.org/web/20220122215354/https://ionicframework.com/docs/react/config
 

Skip to main content


Site LogoSite LogoGuideComponentsCLINativeIonic v6.0.0 Upgrade GuideArrow Forward
v6
v6
v5
v4
v3

Community
Community Hub
Forum
Meetups
Blog
Twitter
Support
Help Center
Customer Support
Enterprise Advisory
English
English

Translate
twitter logogithub logodiscord logo
🌜
🌞

Site LogoSite Logo
Site LogoSite Logo
Getting Started
Overview
Upgrading to Ionic 6
Environment Setup
CLI Installation
Packages & CDN
Next Steps
Developing
Starting
Previewing
Scaffolding
Developing for iOS
Developing for Android
Development Tips
Hardware Back Button
Keyboard
Layout
Structure
Responsive Grid
Global Stylesheets
CSS Utilities
Theming
Basics
Platform Styles
CSS Variables
CSS Shadow Parts
Colors
Themes
Dark Mode
Advanced
Color Generator
Angular
Overview
Build Your First App
Lifecycle
Navigation/Routing
Virtual Scroll
Slides
Config
Platform
Testing
Storage
Performance
Progressive Web Apps
React
Overview
Quickstart
Build Your First App
Lifecycle
Navigation/Routing
Virtual Scroll
Slides
Config
Platform
Progressive Web Apps
Overlays
Storage
Testing
Performance
Vue
Overview
Quickstart
Build Your First App
Lifecycle
Navigation/Routing
Virtual Scroll
Slides
Utility Functions
Config
Platform
Progressive Web Apps
Storage
Testing
Troubleshooting
Performance
Utilities
Animations
Gestures
Deployment
iOS App Store
Android Play Store
Progressive Web App (PWA)
Electron Desktop App
Techniques
Security
Troubleshooting
Debugging
Build Errors
Runtime Issues
Native Errors
CORS Errors
Core Concepts
Fundamentals
Cross Platform
Web View
What are PWAs?
Contributing
How to Contribute
Code of Conduct
Reference
Glossary
Versioning
Release Notes
GitHub Changelog
Support Policy
Browser Support
Migration



Site LogoSite LogoGuideComponentsCLINativeIonic v6.0.0 Upgrade GuideArrow Forward
v6
v6
v5
v4
v3

Community
Community Hub
Forum
Meetups
Blog
Twitter
Support
Help Center
Customer Support
Enterprise Advisory
English
English

Translate
twitter logogithub logodiscord logo
🌜
🌞

Version: v6

Config


Ionic Config provides a way to change the properties of components globally across an app. It can set the app mode, tab button layout, animations, and more.

Global Config

To override the initial Ionic config for the app, import the setupIonicReact function from @ionic/react, and call it before you render any Ionic components (including IonApp).
setupIonicReact({
rippleEffect: false,
mode: 'md',
});

In the above example, we are disabling the Material Design ripple effect across the app, as well as forcing the mode to be Material Design.

Per-Platform Config

Ionic Config can also be set on a per-platform basis. For example, this allows you to disable animations if the app is being run in a browser on a potentially slower device. Developers can take advantage of the Platform utilities to accomplish this.
In the following example, we are disabling all animations in our Ionic app only if the app is running in a mobile web browser. The isPlatform() call returns trueorfalse based upon the platform that is passed in. See the Platform Documentation for a list of possible values.
import { isPlatform, setupIonicReact } from '@ionic/react';

setupIonicReact({
animated: !isPlatform('mobileweb'),
});

The next example allows you to set an entirely different configuration based upon the platform, falling back to a default config if no platforms match:
import { isPlatform, setupIonicReact } from '@ionic/react';

const getConfig = () => {
if (isPlatform('hybrid')) {
return {
backButtonText: 'Previous',
tabButtonLayout: 'label-hide',
};
}

return {
menuIcon: 'ellipsis-vertical',
};
};

setupIonicReact(getConfig());

Finally, this example allows you to accumulate a config object based upon different platform requirements:
import { isPlatform, setupIonicReact } from '@ionic/react';

const getConfig = () => {
let config = {
animated: false,
};

if (isPlatform('iphone')) {
config = {
...config,
backButtonText: 'Previous',
};
}

return config;
};
setupIonicReact(getConfig());

Config Options

Below is a list of config options that Ionic uses.
ConfigTypeDescription
actionSheetEnterAnimationBuilderProvides a custom enter animation for all ion-action-sheet, overriding the default "animation".
actionSheetLeaveAnimationBuilderProvides a custom leave animation for all ion-action-sheet, overriding the default "animation".
alertEnterAnimationBuilderProvides a custom enter animation for all ion-alert, overriding the default "animation".
alertLeaveAnimationBuilderProvides a custom leave animation for all ion-alert, overriding the default "animation".
animatedbooleanIftrue, Ionic will enable all animations and transitions across the app.
backButtonIconstringOverrides the default icon in all <ion-back-button> components.
backButtonTextstringOverrides the default text in all <ion-back-button> components.
hardwareBackButtonbooleanIftrue, Ionic will respond to the hardware back button in an Android device.
infiniteLoadingSpinnerSpinnerTypesOverrides the default spinner type in all <ion-infinite-scroll-content> components.
loadingEnterAnimationBuilderProvides a custom enter animation for all ion-loading, overriding the default "animation".
loadingLeaveAnimationBuilderProvides a custom leave animation for all ion-loading, overriding the default "animation".
loadingSpinnerSpinnerTypesOverrides the default spinner for all ion-loading overlays.
menuIconstringOverrides the default icon in all <ion-menu-button> components.
menuTypestringOverrides the default menu type for all <ion-menu> components.
modalEnterAnimationBuilderProvides a custom enter animation for all ion-modal, overriding the default "animation".
modalLeaveAnimationBuilderProvides a custom leave animation for all ion-modal, overriding the default "animation".
modeModeThe mode determines which platform styles to use for the whole application.
navAnimationAnimationBuilderOverrides the default "animation" of all ion-nav and ion-router-outlet across the whole application.
pickerEnterAnimationBuilderProvides a custom enter animation for all ion-picker, overriding the default "animation".
pickerLeaveAnimationBuilderProvides a custom leave animation for all ion-picker, overriding the default "animation".
platformPlatformConfigOverrides the default platform detection methods.
popoverEnterAnimationBuilderProvides a custom enter animation for all ion-popover, overriding the default "animation".
popoverLeaveAnimationBuilderProvides a custom leave animation for all ion-popover, overriding the default "animation".
refreshingIconstringOverrides the default icon in all <ion-refresh-content> components.
refreshingSpinnerSpinnerTypesOverrides the default spinner type in all <ion-refresh-content> components.
sanitizerEnabledbooleanIftrue, Ionic will enable a basic DOM sanitizer on component properties that accept custom HTML.
spinnerSpinnerTypesOverrides the default spinner in all <ion-spinner> components.
statusTapbooleanIftrue, clicking or tapping the status bar will cause the content to scroll to the top.
swipeBackEnabledbooleanIftrue, Ionic will enable the "swipe-to-go-back" gesture across the application.
tabButtonLayoutTabButtonLayoutOverrides the default "layout" of all ion-bar-button across the whole application.
toastEnterAnimationBuilderProvides a custom enter animation for all ion-toast, overriding the default "animation".
toastLeaveAnimationBuilderProvides a custom leave animation for all ion-toast, overriding the default "animation".

Edit this page


Previous
« Slides

Next
Platform »

Contents

Global Config
Per-Platform Config
Config Options
Edit this page