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
The available config keys can be found in the IonicConfig interface.
The following example disables ripple effects and default the mode to Material Design:
- JavaScript
- Angular
- Angular (Standalone)
- React
- Vue
example.js
window.Ionic = {
config: {
rippleEffect: false,
mode: 'md',
},
};
app.module.ts
import { IonicModule } from '@ionic/angular';
@NgModule({
...
imports: [
IonicModule.forRoot({
rippleEffect: false,
mode: 'md'
})
],
...
})
main.ts
import { provideIonicAngular } from '@ionic/angular/standalone';
bootstrapApplication(AppComponent, {
providers: [
...,
provideIonicAngular({
rippleEffect: false,
mode: 'md'
})
]
})
The setupIonicReact function must be called before rendering any Ionic components (including IonApp).
App.tsx
import { setupIonicReact } from '@ionic/react';
setupIonicReact({
rippleEffect: false,
mode: 'md',
});
main.ts
import { IonicVue } from '@ionic/vue';
import { createApp } from 'vue';
createApp(App).use(IonicVue, {
rippleEffect: false,
mode: 'md',
});