Ionic-framework: Position Toast Bottom, Middle, Top of screen

Created on 21 Apr 2016  路  3Comments  路  Source: ionic-team/ionic-framework

I would like to be able to position the toast view dynamically to fit whatever use case I may have. It is common practice among toast views for them to show up at the bottom, top or middle of the screen.

The toast cordova plugin provides this functionality and I think Ionites would take advantage of this.

This is for Ionic 2.0

Most helpful comment

Probably something like:

const toast = Toast.create({
  message: 'User was created successfully',
  position: 'top'
});

Then add a class for the position.

All 3 comments

Probably something like:

const toast = Toast.create({
  message: 'User was created successfully',
  position: 'top'
});

Then add a class for the position.

+1

I'd love to see this too. In the current beta.6, I can position the toast using the cssClass field but I'm having a bit of trouble with the default CSS animation that makes it slides up when visible then down when hiding (i.e. doesn't go well with a top-positioned toast).

PR'd and submitted. Closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SebastianGiro picture SebastianGiro  路  3Comments

Macstyg picture Macstyg  路  3Comments

Nick-The-Uncharted picture Nick-The-Uncharted  路  3Comments

giammaleoni picture giammaleoni  路  3Comments

alexbainbridge picture alexbainbridge  路  3Comments