Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: swipeable segment (swipe on content to move segment) #17804

Open
NgYueHong opened this issue Mar 16, 2019 · 13 comments
Open

feat: swipeable segment (swipe on content to move segment) #17804

NgYueHong opened this issue Mar 16, 2019 · 13 comments
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement

Comments

@NgYueHong
Copy link

Feature Request

Ionic version:

[x] 4.x

Describe the Feature Request

Swipeable tabs is a common and long requested feature to have on Ionic. Really hope to see swipeable tabs feature in Ionic 4 soon.

@ionitron-bot ionitron-bot bot added the triage label Mar 16, 2019
@brandyscarney
Copy link
Member

Thanks for the issue! The scrollable tabs that you see in the Material Design spec is available in our Segment component using the scrollable property.

Please see the usage information on that page: https://ionicframework.com/docs/api/segment#usage

They can be combined with slides to achieve a swipe between views effect, see this example Codepen: https://codepen.io/brandyscarney/pen/maOabQ?editors=1010

@nicolasrhone
Copy link

But this way, we don't have possibility to lazy load slides... which would be great!

@liamdebeasi liamdebeasi added the type: feature request a new feature, enhancement, or improvement label Mar 25, 2019
@ionitron-bot ionitron-bot bot removed the triage label Mar 25, 2019
@brandyscarney brandyscarney added the package: core @ionic/core package label Apr 2, 2019
@uriannrima
Copy link

Thanks for the great example @brandyscarney!!! Was having some trouble using the tabs for that.

By the way, for those looking for a better "feel" for when changing the segment when scrolling the panel, you may use "ionSlideWillChange". It seems a bit better than "onDid".

@bunday
Copy link

bunday commented Jun 11, 2019

Very Helpful

@khashashin
Copy link

Some additional api for swiping segments would be also greate. There are no way to swipe them programmatically. Otherwise please provide some issue solver hier https://stackoverflow.com/q/57047922/7986808

@sagits
Copy link

sagits commented Dec 11, 2019

Hi, in my case using sliders was a bad solution because i need the lazyloading. I ended up using segments with this lib:

https://github.com/diogoqueiros/ionic-swipe-all

@NgYueHong
Copy link
Author

@BrandonShar Are we able to see Swipeable Tab on Ionic 5?

@hellokingdom
Copy link

@BrandonShar it's typical in this scenario for each slide to have an independently scrollable content area but the examples I have seen a linked due to a single ion-content.

Is there an agreed approach for this inside the constraints of the ionic framework?

@shashwat44
Copy link

in ionic 5 : issue occurs

[ng] ERROR in node_modules/ionic2-super-tabs/dist/components/super-tab.d.ts:2:132 - error TS2307: Cannot find module 'ionic-angular'.
[ng] 2 import { App, Config, DeepLinker, DomController, GestureController, NavControllerBase, NavOptions, Platform, ViewController } from 'ionic-angular';
[ng] ~~~~~~~~~~~~~~~
[ng] node_modules/ionic2-super-tabs/dist/components/super-tab.d.ts:3:38 - error TS2307: Cannot find module 'ionic-angular/transitions/transition-controller'.
[ng] 3 import { TransitionController } from 'ionic-angular/transitions/transition-controller';
[ng] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng] node_modules/ionic2-super-tabs/dist/components/super-tabs.d.ts:5:118 - error TS2307: Cannot find module 'ionic-angular'.
[ng] 5 import { App, DeepLinker, DomController, NavController, NavControllerBase, Platform, RootNode, ViewController } from 'ionic-angular';
[ng] ~~~~~~~~~~~~~~~
[ng] node_modules/ionic2-super-tabs/dist/components/super-tabs.d.ts:6:37 - error TS2307: Cannot find module 'ionic-angular/navigation/navigation-container'.
[ng] 6 import { NavigationContainer } from 'ionic-angular/navigation/navigation-container';
[ng] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ng]

@NeckbreakerPascal
Copy link

Thanks for the issue! The scrollable tabs that you see in the Material Design spec is available in our Segment component using the scrollable property.

Please see the usage information on that page: https://ionicframework.com/docs/api/segment#usage

They can be combined with slides to achieve a swipe between views effect, see this example Codepen: https://codepen.io/brandyscarney/pen/maOabQ?editors=1010

Are there any changes with this for ionic5? I tried but it did not work. I use ion-tabs and have 3 tabs with ion-slides.

Only on the First (initial) slider I can use the ion-segment to change the sliders, on the others the segment-indicator is moving but slideTo does not work. Also getActiveIndex and the rest of it.

It is kind of strange that the ionslidedidLoad event is triggered multiple times. Maybe there is some error, or I did something wrong. or I should open an new issue, not sure if it is related to this .Was just hoping your code will save me. :D

@juny58
Copy link

juny58 commented May 25, 2020

I have long waited for this, finally made one web-component with ionic's stencil. It works in any platform and in all popular frameworks.

https://www.npmjs.com/package/mat-tab-swiper

@juny58
Copy link

juny58 commented May 25, 2020

Thanks for the issue! The scrollable tabs that you see in the Material Design spec is available in our Segment component using the scrollable property.

Please see the usage information on that page: https://ionicframework.com/docs/api/segment#usage

They can be combined with slides to achieve a swipe between views effect, see this example Codepen: https://codepen.io/brandyscarney/pen/maOabQ?editors=1010

I have long waited for this, finally made one web-component with ionic's stencil. It works in any platform and in all popular frameworks.

https://www.npmjs.com/package/mat-tab-swiper
tabswiperexample

@ntorrey
Copy link

ntorrey commented Apr 28, 2022

Would love to see this as a built-in feature!

@liamdebeasi liamdebeasi changed the title Ionic 4 Swipeable Tab feat: swipeable segment (swipe on content to move segment) Sep 26, 2022
@liamdebeasi liamdebeasi added type: feature request a new feature, enhancement, or improvement and removed type: feature request a new feature, enhancement, or improvement labels Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: core @ionic/core package type: feature request a new feature, enhancement, or improvement
Projects
None yet
Development

No branches or pull requests