-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs(modal): playground for auto height sheets #2905
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
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
90bb608
docs(EN-3565): playground for auto height sheets
thetaPC 8c32411
fix(modal): missing new line
thetaPC 537c567
Merge branch 'main' of github.com:ionic-team/ionic-docs into FW-3565
thetaPC 979659d
docs(modal): file structure
thetaPC e94f9c9
Merge branch 'main' of github.com:ionic-team/ionic-docs into FW-3565
thetaPC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
static/usage/v7/modal/sheet/auto-height/angular/example_component_css.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ```css | ||
| .block { | ||
| width: 100%; | ||
| height: 300px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| ion-modal { | ||
| --height: auto; | ||
| } | ||
| ``` |
16 changes: 16 additions & 0 deletions
16
static/usage/v7/modal/sheet/auto-height/angular/example_component_html.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ```html | ||
| <ion-header> | ||
| <ion-toolbar> | ||
| <ion-title>App</ion-title> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
| <ion-content class="ion-padding"> | ||
| <ion-button id="open-modal" expand="block">Open Sheet Modal</ion-button> | ||
|
|
||
| <ion-modal #modal trigger="open-modal" [initialBreakpoint]="1" [breakpoints]="[0, 1]"> | ||
| <ng-template> | ||
| <div class="block">Block of Content</div> | ||
| </ng-template> | ||
| </ion-modal> | ||
| </ion-content> | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Modal | Sheet</title> | ||
| <link rel="stylesheet" href="../../../../common.css" /> | ||
| <script src="../../../../common.js"></script> | ||
| <script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@7/dist/ionic/ionic.esm.js"></script> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@7/css/ionic.bundle.css" /> | ||
| <style> | ||
| .block { | ||
| width: 100%; | ||
| height: 300px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| ion-modal { | ||
| --height: auto; | ||
| } | ||
| </style> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-header> | ||
| <ion-toolbar> | ||
| <ion-title>App</ion-title> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
| <ion-content class="ion-padding"> | ||
| <ion-button id="open-modal" expand="block">Open Sheet Modal</ion-button> | ||
|
|
||
| <ion-modal trigger="open-modal"> | ||
| <div class="block">Block of Content</div> | ||
| </ion-modal> | ||
| </ion-content> | ||
| </ion-app> | ||
|
|
||
| <script> | ||
| const modal = document.querySelector('ion-modal'); | ||
|
|
||
| modal.initialBreakpoint = 1; | ||
| modal.breakpoints = [0, 1]; | ||
| </script> | ||
| </body> | ||
|
|
||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import Playground from '@site/src/components/global/Playground'; | ||
|
|
||
| import javascript from './javascript.md'; | ||
| import vue from './vue.md'; | ||
| import react from './react.md'; | ||
| import angular_example_component_html from './angular/example_component_html.md'; | ||
| import angular_example_component_css from './angular/example_component_css.md'; | ||
|
|
||
| <Playground | ||
| version="7" | ||
| code={{ | ||
| javascript, | ||
| react, | ||
| vue, | ||
| angular: { | ||
| files: { | ||
| 'src/app/example.component.html': angular_example_component_html, | ||
| 'src/app/example.component.css': angular_example_component_css, | ||
| }, | ||
| }, | ||
| }} | ||
| src="usage/v7/modal/sheet/auto-height/demo.html" | ||
| devicePreview | ||
| includeIonContent={false} | ||
| /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| ```html | ||
| <style> | ||
| .block { | ||
| width: 100%; | ||
| height: 300px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| ion-modal { | ||
| --height: auto; | ||
| } | ||
| </style> | ||
|
|
||
| <ion-header> | ||
| <ion-toolbar> | ||
| <ion-title>App</ion-title> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
| <ion-content class="ion-padding"> | ||
| <ion-button id="open-modal" expand="block">Open Sheet Modal</ion-button> | ||
|
|
||
| <ion-modal trigger="open-modal"> | ||
| <div class="block">Block of Content</div> | ||
| </ion-modal> | ||
| </ion-content> | ||
|
|
||
| <script> | ||
| var modal = document.querySelector('ion-modal'); | ||
|
|
||
| modal.initialBreakpoint = 1; | ||
| modal.breakpoints = [0, 1]; | ||
| </script> | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| ```tsx | ||
| import React, { useRef } from 'react'; | ||
| import { | ||
| IonButton, | ||
| IonModal, | ||
| IonHeader, | ||
| IonContent, | ||
| IonToolbar, | ||
| IonTitle, | ||
| IonPage, | ||
| } from '@ionic/react'; | ||
|
|
||
| function Example() { | ||
| const modal = useRef<HTMLIonModalElement>(null); | ||
|
|
||
| return ( | ||
| <IonPage> | ||
| <IonHeader> | ||
| <IonToolbar> | ||
| <IonTitle>App</IonTitle> | ||
| </IonToolbar> | ||
| </IonHeader> | ||
| <IonContent className="ion-padding"> | ||
| <IonButton id="open-modal" expand="block"> | ||
| Open Sheet Modal | ||
| </IonButton> | ||
| <IonModal | ||
| ref={modal} | ||
| trigger="open-modal" | ||
| initialBreakpoint={1} | ||
| breakpoints={[0, 1]} | ||
| style={{ | ||
| '--height': 'auto', | ||
| }} | ||
| > | ||
| <div | ||
| style={{ | ||
| 'width': '100%', | ||
| 'height': '300px', | ||
| 'display': 'flex', | ||
| 'alignItems': 'center', | ||
| 'justifyContent': 'center', | ||
| }} | ||
averyjohnston marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| > | ||
| Block of Content | ||
| </div> | ||
| </IonModal> | ||
| </IonContent> | ||
| </IonPage> | ||
| ); | ||
| } | ||
|
|
||
| export default Example; | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| ```html | ||
| <style> | ||
| .block { | ||
| width: 100%; | ||
| height: 300px; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| ion-modal { | ||
| --height: auto; | ||
| } | ||
| </style> | ||
|
|
||
| <template> | ||
| <ion-header> | ||
| <ion-toolbar> | ||
| <ion-title>App</ion-title> | ||
| </ion-toolbar> | ||
| </ion-header> | ||
| <ion-content class="ion-padding"> | ||
| <ion-button id="open-modal" expand="block">Open Sheet Modal</ion-button> | ||
|
|
||
| <ion-modal ref="modal" trigger="open-modal" :initial-breakpoint="1" :breakpoints="[0, 1]"> | ||
averyjohnston marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| <div class="block">Block of Content</div> | ||
| </ion-modal> | ||
| </ion-content> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { | ||
| IonButton, | ||
| IonModal, | ||
| IonHeader, | ||
| IonContent, | ||
| IonToolbar, | ||
| IonTitle, | ||
| } from '@ionic/vue'; | ||
| import { defineComponent } from 'vue'; | ||
|
|
||
| export default defineComponent({ | ||
| components: { | ||
| IonButton, | ||
| IonModal, | ||
| IonHeader, | ||
| IonContent, | ||
| IonToolbar, | ||
| IonTitle, | ||
| }, | ||
| }); | ||
| </script> | ||
| ``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.