├── .gitignore ├── README.md ├── next-env.d.ts ├── package-lock.json ├── package.json ├── pages ├── _app.tsx ├── index.tsx └── tabs │ ├── Tab2.tsx │ ├── Tab3.tsx │ └── tab1 │ ├── Index.tsx │ └── details │ └── [id].tsx ├── public ├── favicon.ico └── zeit.svg ├── theme ├── global.css └── variables.css └── tsconfig.json /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | .env* 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | See [mlynch/nextjs-tailwind-ionic-capacitor-starter](https://github.com/mlynch/nextjs-tailwind-ionic-capacitor-starter) for a more elaborate example of using Next.js with Tailwind and Ionic/Capacitor 2 | 3 | ---------------- 4 | 5 | This repo is now archived: 6 | 7 | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/zeit/next.js/tree/canary/packages/create-next-app). 8 | 9 | ## Getting Started 10 | 11 | First, run the development server: 12 | 13 | ```bash 14 | npm run dev 15 | # or 16 | yarn dev 17 | ``` 18 | 19 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 20 | 21 | You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. 22 | 23 | ## Learn More 24 | 25 | To learn more about Next.js, take a look at the following resources: 26 | 27 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 28 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 29 | 30 | You can check out [the Next.js GitHub repository](https://github.com/zeit/next.js/) - your feedback and contributions are welcome! 31 | 32 | ## Deploy on ZEIT Now 33 | 34 | The easiest way to deploy your Next.js app is to use the [ZEIT Now Platform](https://zeit.co/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 35 | 36 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. 37 | -------------------------------------------------------------------------------- /next-env.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | /// 3 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ionic-react-nextjs-starter", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start" 9 | }, 10 | "dependencies": { 11 | "@ionic/react": "^5.0.7-nextjs-alpha.1", 12 | "@ionic/react-next-router": "^5.0.7-nextjs-alpha.1", 13 | "next": "^9.3.4", 14 | "react": "16.13.0", 15 | "react-dom": "16.13.0" 16 | }, 17 | "devDependencies": { 18 | "@types/node": "^13.9.2", 19 | "@types/react": "^16.9.23", 20 | "typescript": "^3.8.3" 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /pages/_app.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | 3 | /* Core CSS required for Ionic components to work properly */ 4 | import '@ionic/react/css/core.css'; 5 | 6 | /* Basic CSS for apps built with Ionic */ 7 | import '@ionic/react/css/normalize.css'; 8 | import '@ionic/react/css/structure.css'; 9 | import '@ionic/react/css/typography.css'; 10 | 11 | /* Optional CSS utils that can be commented out */ 12 | import '@ionic/react/css/padding.css'; 13 | import '@ionic/react/css/float-elements.css'; 14 | import '@ionic/react/css/text-alignment.css'; 15 | import '@ionic/react/css/text-transformation.css'; 16 | import '@ionic/react/css/flex-utils.css'; 17 | import '@ionic/react/css/display.css'; 18 | import { IonRouterOutlet, IonApp, IonTabs, IonTabBar, IonTabButton, IonIcon, IonLabel } from '@ionic/react'; 19 | import dynamic from 'next/dynamic'; 20 | import { IonNextRouter } from '@ionic/react-next-router'; 21 | import { ellipse, square, triangle } from 'ionicons/icons'; 22 | 23 | /* Theme variables */ 24 | import '../theme/global.css'; 25 | import '../theme/variables.css'; 26 | 27 | /* This controls if SSR is on or not. Enabling it works but with warnings at the moment */ 28 | export default dynamic(() => Promise.resolve(MyApp), { 29 | ssr: false 30 | }); 31 | 32 | function MyApp({ Component, pageProps }) { 33 | return ( 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | Tab 1 44 | 45 | 46 | 47 | Tab 2 48 | 49 | 50 | 51 | Tab 3 52 | 53 | 54 | 55 | 56 | 57 | ); 58 | } -------------------------------------------------------------------------------- /pages/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect, useContext } from 'react'; 2 | import { NavContext } from '@ionic/react'; 3 | 4 | 5 | const Index: React.FC = () => { 6 | const context = useContext(NavContext); 7 | useEffect(() => { 8 | if (context.currentPath === '/') { 9 | context.navigate('/tabs/tab1', 'none', 'replace', { as: '/tabs/tab1' }); 10 | } 11 | }, []); 12 | 13 | return null; 14 | }; 15 | 16 | export default Index; -------------------------------------------------------------------------------- /pages/tabs/Tab2.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react'; 3 | 4 | const Tab2: React.FC = () => { 5 | return ( 6 | 7 | 8 | 9 | Tab 2 10 | 11 | 12 | 13 | 14 | 15 | Tab 2 16 | 17 | 18 | 19 | 20 | 21 | ); 22 | }; 23 | 24 | export default Tab2; 25 | -------------------------------------------------------------------------------- /pages/tabs/Tab3.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/react'; 3 | 4 | const Tab2: React.FC = () => { 5 | return ( 6 | 7 | 8 | 9 | Tab 3 10 | 11 | 12 | 13 | 14 | 15 | Tab 3 16 | 17 | 18 | 19 | 20 | 21 | ); 22 | }; 23 | 24 | export default Tab2; 25 | -------------------------------------------------------------------------------- /pages/tabs/tab1/Index.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar, IonItem, IonLabel } from '@ionic/react'; 3 | 4 | interface Tab1Props { } 5 | 6 | const Tab1: React.FC = () => { 7 | return ( 8 | 9 | 10 | 11 | Ionic React Next App 12 | 13 | 14 | 15 | 16 | Details 1 17 | 18 | 19 | Details 2 20 | 21 | 22 | 23 | ); 24 | }; 25 | 26 | export default Tab1; -------------------------------------------------------------------------------- /pages/tabs/tab1/details/[id].tsx: -------------------------------------------------------------------------------- 1 | import { IonPage, IonHeader, IonToolbar, IonTitle, IonContent, IonButtons, IonBackButton } from '@ionic/react'; 2 | import { useRouter } from 'next/dist/client/router'; 3 | 4 | const Details: React.FC = () => { 5 | 6 | const router = useRouter(); 7 | 8 | return ( 9 | 10 | 11 | 12 | 13 | 14 | 15 | Details {router.query.id} 16 | 17 | 18 | 19 | 20 | 21 | Details {router.query.id} 22 | 23 | 24 | 25 | 26 | 27 | 28 | ); 29 | }; 30 | 31 | export default Details; -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ionic-team/ionic-react-nextjs-starter/59d69e5def820bd1e5e51249b010bf15ebbd75a5/public/favicon.ico -------------------------------------------------------------------------------- /public/zeit.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /theme/global.css: -------------------------------------------------------------------------------- 1 | @media (prefers-color-scheme: dark) { 2 | /* 3 | * Dark Colors 4 | * ------------------------------------------- 5 | */ 6 | 7 | body { 8 | --ion-color-primary: #428cff; 9 | --ion-color-primary-rgb: 66,140,255; 10 | --ion-color-primary-contrast: #ffffff; 11 | --ion-color-primary-contrast-rgb: 255,255,255; 12 | --ion-color-primary-shade: #3a7be0; 13 | --ion-color-primary-tint: #5598ff; 14 | 15 | --ion-color-secondary: #50c8ff; 16 | --ion-color-secondary-rgb: 80,200,255; 17 | --ion-color-secondary-contrast: #ffffff; 18 | --ion-color-secondary-contrast-rgb: 255,255,255; 19 | --ion-color-secondary-shade: #46b0e0; 20 | --ion-color-secondary-tint: #62ceff; 21 | 22 | --ion-color-tertiary: #6a64ff; 23 | --ion-color-tertiary-rgb: 106,100,255; 24 | --ion-color-tertiary-contrast: #ffffff; 25 | --ion-color-tertiary-contrast-rgb: 255,255,255; 26 | --ion-color-tertiary-shade: #5d58e0; 27 | --ion-color-tertiary-tint: #7974ff; 28 | 29 | --ion-color-success: #2fdf75; 30 | --ion-color-success-rgb: 47,223,117; 31 | --ion-color-success-contrast: #000000; 32 | --ion-color-success-contrast-rgb: 0,0,0; 33 | --ion-color-success-shade: #29c467; 34 | --ion-color-success-tint: #44e283; 35 | 36 | --ion-color-warning: #ffd534; 37 | --ion-color-warning-rgb: 255,213,52; 38 | --ion-color-warning-contrast: #000000; 39 | --ion-color-warning-contrast-rgb: 0,0,0; 40 | --ion-color-warning-shade: #e0bb2e; 41 | --ion-color-warning-tint: #ffd948; 42 | 43 | --ion-color-danger: #ff4961; 44 | --ion-color-danger-rgb: 255,73,97; 45 | --ion-color-danger-contrast: #ffffff; 46 | --ion-color-danger-contrast-rgb: 255,255,255; 47 | --ion-color-danger-shade: #e04055; 48 | --ion-color-danger-tint: #ff5b71; 49 | 50 | --ion-color-dark: #f4f5f8; 51 | --ion-color-dark-rgb: 244,245,248; 52 | --ion-color-dark-contrast: #000000; 53 | --ion-color-dark-contrast-rgb: 0,0,0; 54 | --ion-color-dark-shade: #d7d8da; 55 | --ion-color-dark-tint: #f5f6f9; 56 | 57 | --ion-color-medium: #989aa2; 58 | --ion-color-medium-rgb: 152,154,162; 59 | --ion-color-medium-contrast: #000000; 60 | --ion-color-medium-contrast-rgb: 0,0,0; 61 | --ion-color-medium-shade: #86888f; 62 | --ion-color-medium-tint: #a2a4ab; 63 | 64 | --ion-color-light: #222428; 65 | --ion-color-light-rgb: 34,36,40; 66 | --ion-color-light-contrast: #ffffff; 67 | --ion-color-light-contrast-rgb: 255,255,255; 68 | --ion-color-light-shade: #1e2023; 69 | --ion-color-light-tint: #383a3e; 70 | } 71 | 72 | /* 73 | * iOS Dark Theme 74 | * ------------------------------------------- 75 | */ 76 | 77 | .ios body { 78 | --ion-background-color: #000000; 79 | --ion-background-color-rgb: 0,0,0; 80 | 81 | --ion-text-color: #ffffff; 82 | --ion-text-color-rgb: 255,255,255; 83 | 84 | --ion-color-step-50: #0d0d0d; 85 | --ion-color-step-100: #1a1a1a; 86 | --ion-color-step-150: #262626; 87 | --ion-color-step-200: #333333; 88 | --ion-color-step-250: #404040; 89 | --ion-color-step-300: #4d4d4d; 90 | --ion-color-step-350: #595959; 91 | --ion-color-step-400: #666666; 92 | --ion-color-step-450: #737373; 93 | --ion-color-step-500: #808080; 94 | --ion-color-step-550: #8c8c8c; 95 | --ion-color-step-600: #999999; 96 | --ion-color-step-650: #a6a6a6; 97 | --ion-color-step-700: #b3b3b3; 98 | --ion-color-step-750: #bfbfbf; 99 | --ion-color-step-800: #cccccc; 100 | --ion-color-step-850: #d9d9d9; 101 | --ion-color-step-900: #e6e6e6; 102 | --ion-color-step-950: #f2f2f2; 103 | 104 | --ion-toolbar-background: #0d0d0d; 105 | 106 | --ion-item-background: #1c1c1c; 107 | --ion-item-background-activated: #313131; 108 | } 109 | 110 | 111 | /* 112 | * Material Design Dark Theme 113 | * ------------------------------------------- 114 | */ 115 | 116 | .md body { 117 | --ion-background-color: #121212; 118 | --ion-background-color-rgb: 18,18,18; 119 | 120 | --ion-text-color: #ffffff; 121 | --ion-text-color-rgb: 255,255,255; 122 | 123 | --ion-border-color: #222222; 124 | 125 | --ion-color-step-50: #1e1e1e; 126 | --ion-color-step-100: #2a2a2a; 127 | --ion-color-step-150: #363636; 128 | --ion-color-step-200: #414141; 129 | --ion-color-step-250: #4d4d4d; 130 | --ion-color-step-300: #595959; 131 | --ion-color-step-350: #656565; 132 | --ion-color-step-400: #717171; 133 | --ion-color-step-450: #7d7d7d; 134 | --ion-color-step-500: #898989; 135 | --ion-color-step-550: #949494; 136 | --ion-color-step-600: #a0a0a0; 137 | --ion-color-step-650: #acacac; 138 | --ion-color-step-700: #b8b8b8; 139 | --ion-color-step-750: #c4c4c4; 140 | --ion-color-step-800: #d0d0d0; 141 | --ion-color-step-850: #dbdbdb; 142 | --ion-color-step-900: #e7e7e7; 143 | --ion-color-step-950: #f3f3f3; 144 | 145 | --ion-item-background: #1A1B1E; 146 | } 147 | 148 | ion-title.title-large { 149 | --color: white; 150 | } 151 | } -------------------------------------------------------------------------------- /theme/variables.css: -------------------------------------------------------------------------------- 1 | /* Ionic Variables and Theming. For more info, please see: 2 | http://ionicframework.com/docs/theming/ */ 3 | 4 | /** Ionic CSS Variables **/ 5 | :root { 6 | /** primary **/ 7 | --ion-color-primary: #3880ff; 8 | --ion-color-primary-rgb: 56, 128, 255; 9 | --ion-color-primary-contrast: #ffffff; 10 | --ion-color-primary-contrast-rgb: 255, 255, 255; 11 | --ion-color-primary-shade: #3171e0; 12 | --ion-color-primary-tint: #4c8dff; 13 | 14 | /** secondary **/ 15 | --ion-color-secondary: #3dc2ff; 16 | --ion-color-secondary-rgb: 61, 194, 255; 17 | --ion-color-secondary-contrast: #ffffff; 18 | --ion-color-secondary-contrast-rgb: 255, 255, 255; 19 | --ion-color-secondary-shade: #36abe0; 20 | --ion-color-secondary-tint: #50c8ff; 21 | 22 | /** tertiary **/ 23 | --ion-color-tertiary: #5260ff; 24 | --ion-color-tertiary-rgb: 82, 96, 255; 25 | --ion-color-tertiary-contrast: #ffffff; 26 | --ion-color-tertiary-contrast-rgb: 255, 255, 255; 27 | --ion-color-tertiary-shade: #4854e0; 28 | --ion-color-tertiary-tint: #6370ff; 29 | 30 | /** success **/ 31 | --ion-color-success: #2dd36f; 32 | --ion-color-success-rgb: 45, 211, 111; 33 | --ion-color-success-contrast: #ffffff; 34 | --ion-color-success-contrast-rgb: 255, 255, 255; 35 | --ion-color-success-shade: #28ba62; 36 | --ion-color-success-tint: #42d77d; 37 | 38 | /** warning **/ 39 | --ion-color-warning: #ffc409; 40 | --ion-color-warning-rgb: 255, 196, 9; 41 | --ion-color-warning-contrast: #000000; 42 | --ion-color-warning-contrast-rgb: 0, 0, 0; 43 | --ion-color-warning-shade: #e0ac08; 44 | --ion-color-warning-tint: #ffca22; 45 | 46 | /** danger **/ 47 | --ion-color-danger: #eb445a; 48 | --ion-color-danger-rgb: 235, 68, 90; 49 | --ion-color-danger-contrast: #ffffff; 50 | --ion-color-danger-contrast-rgb: 255, 255, 255; 51 | --ion-color-danger-shade: #cf3c4f; 52 | --ion-color-danger-tint: #ed576b; 53 | 54 | /** dark **/ 55 | --ion-color-dark: #222428; 56 | --ion-color-dark-rgb: 34, 36, 40; 57 | --ion-color-dark-contrast: #ffffff; 58 | --ion-color-dark-contrast-rgb: 255, 255, 255; 59 | --ion-color-dark-shade: #1e2023; 60 | --ion-color-dark-tint: #383a3e; 61 | 62 | /** medium **/ 63 | --ion-color-medium: #92949c; 64 | --ion-color-medium-rgb: 146, 148, 156; 65 | --ion-color-medium-contrast: #ffffff; 66 | --ion-color-medium-contrast-rgb: 255, 255, 255; 67 | --ion-color-medium-shade: #808289; 68 | --ion-color-medium-tint: #9d9fa6; 69 | 70 | /** light **/ 71 | --ion-color-light: #f4f5f8; 72 | --ion-color-light-rgb: 244, 245, 248; 73 | --ion-color-light-contrast: #000000; 74 | --ion-color-light-contrast-rgb: 0, 0, 0; 75 | --ion-color-light-shade: #d7d8da; 76 | --ion-color-light-tint: #f5f6f9; 77 | } 78 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "lib": [ 5 | "dom", 6 | "dom.iterable", 7 | "esnext" 8 | ], 9 | "allowJs": true, 10 | "skipLibCheck": true, 11 | "strict": false, 12 | "forceConsistentCasingInFileNames": true, 13 | "noEmit": true, 14 | "esModuleInterop": true, 15 | "module": "esnext", 16 | "moduleResolution": "node", 17 | "resolveJsonModule": true, 18 | "isolatedModules": true, 19 | "jsx": "preserve" 20 | }, 21 | "exclude": [ 22 | "node_modules" 23 | ], 24 | "include": [ 25 | "next-env.d.ts", 26 | "**/*.ts", 27 | "**/*.tsx" 28 | ] 29 | } 30 | --------------------------------------------------------------------------------