ion-footer
Contents
Footer is a root component of a page that sits at the bottom of the page. Footer can be a wrapper for ion-toolbar to make sure the content area is sized correctly.
Fade Footer
The collapse
property can be set to 'fade'
on a page's ion-footer
to have the background color of the toolbars fade in as users scroll. This provides the same fade effect that is found in many native iOS applications.
Usage with Virtual Scroll
Fade footer requires a scroll container to function. When using a virtual scrolling solution, you will need to disable scrolling on the ion-content
and indicate which element container is responsible for the scroll container with the .ion-content-scroll-host
class target.
<ion-content scroll-y="false">
<virtual-scroll-element class="ion-content-scroll-host">
<!-- Your virtual scroll content -->
</virtual-scroll-element>
</ion-content>
<ion-footer collapse="fade">
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
Usage
- Angular
- Javascript
- React
- Stencil
- Vue
<ion-content></ion-content>
<!-- Footer without a border -->
<ion-footer class="ion-no-border">
<ion-toolbar>
<ion-title>Footer - No Border</ion-title>
</ion-toolbar>
</ion-footer>
<ion-footer>
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
<!-- Fade Footer -->
<ion-footer collapse="fade">
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
<ion-content></ion-content>
<!-- Footer without a border -->
<ion-footer class="ion-no-border">
<ion-toolbar>
<ion-title>Footer - No Border</ion-title>
</ion-toolbar>
</ion-footer>
<ion-footer>
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
<!-- Fade Footer -->
<ion-footer collapse="fade">
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
import React from 'react';
import { IonContent, IonFooter, IonToolbar, IonTitle } from '@ionic/react';
export const FooterExample: React.FC = () => (
<>
<IonContent />
{/*-- Footer without a border --*/}
<IonFooter className="ion-no-border">
<IonToolbar>
<IonTitle>Footer - No Border</IonTitle>
</IonToolbar>
</IonFooter>
<IonFooter>
<IonToolbar>
<IonTitle>Footer</IonTitle>
</IonToolbar>
</IonFooter>
{/*-- Fade Footer --*/}
<IonFooter collapse="fade">
<IonToolbar>
<IonTitle>Footer</IonTitle>
</IonToolbar>
</IonFooter>
</>
);
import { Component, h } from '@stencil/core';
@Component({
tag: 'footer-example',
styleUrl: 'footer-example.css'
})
export class FooterExample {
render() {
return [
<ion-content></ion-content>,
{/*-- Footer without a border --*/}
<ion-footer class="ion-no-border">
<ion-toolbar>
<ion-title>Footer - No Border</ion-title>
</ion-toolbar>
</ion-footer>,
<ion-footer>
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>,
{/*-- Fade Footer --*/}
<ion-footer collapse="fade">
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
];
}
}
<template>
<ion-content></ion-content>
<!-- Footer without a border -->
<ion-footer class="ion-no-border">
<ion-toolbar>
<ion-title>Footer - No Border</ion-title>
</ion-toolbar>
</ion-footer>
<ion-footer>
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
<!-- Fade Footer -->
<ion-footer collapse="fade">
<ion-toolbar>
<ion-title>Footer</ion-title>
</ion-toolbar>
</ion-footer>
</template>
<script>
import { IonContent, IonFooter, IonTitle, IonToolbar } from '@ionic/vue';
import { defineComponent } from 'vue';
export default defineComponent({
components: { IonContent, IonFooter, IonTitle, IonToolbar }
});
</script>
Properties
collapse
Description | Describes the scroll effect that will be applied to the footer. Only applies in iOS mode. |
Attribute | collapse |
Type | "fade" ๏ฝ undefined |
Default | undefined |
mode
Description | The mode determines which platform styles to use. |
Attribute | mode |
Type | "ios" ๏ฝ "md" |
Default | undefined |
translucent
Description | If true , the footer will be translucent. Only applies when the mode is "ios" and the device supports backdrop-filter .Note: In order to scroll content behind the footer, the fullscreen attribute needs to be set on the content. |
Attribute | translucent |
Type | boolean |
Default | false |