-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs(select): add label slot and aria label playgrounds #2971
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
+249
−9
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
953cba5
docs(select): add label slot playground
liamdebeasi f863010
fix typos
liamdebeasi fce940a
docs(select): add no visible label playground
liamdebeasi 3a15071
clean up styles
liamdebeasi 7725f15
fix spacing
liamdebeasi 7160cb5
move labels up
liamdebeasi 4ced49e
remove dev build
liamdebeasi 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
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,15 @@ | ||
| ```html | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select placeholder="Select a fruit"> | ||
| <div slot="label"> | ||
| Favorite Fruit | ||
| <ion-text color="danger">(Required)</ion-text> | ||
| </div> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| ``` |
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,34 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>select</title> | ||
| <link rel="stylesheet" href="../../../common.css" /> | ||
| <script src="../../../common.js"></script> | ||
| <script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/[email protected]/dist/ionic/ionic.esm.js"></script> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/[email protected]/css/ionic.bundle.css" /> | ||
|
||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-content> | ||
| <div class="container"> | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select placeholder="Select a fruit"> | ||
| <div slot="label"> | ||
| Favorite Fruit | ||
| <ion-text color="danger">(Required)</ion-text> | ||
| </div> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| </div> | ||
| </ion-content> | ||
| </ion-app> | ||
| </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,13 @@ | ||
| import Playground from '@site/src/components/global/Playground'; | ||
|
|
||
| import javascript from './javascript.md'; | ||
| import react from './react.md'; | ||
| import vue from './vue.md'; | ||
| import angular from './angular.md'; | ||
|
|
||
| <Playground | ||
| version="7" | ||
| code={{ javascript, react, vue, angular }} | ||
| src="usage/v7/select/label-slot/demo.html" | ||
| size="300px" | ||
| /> |
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,15 @@ | ||
| ```html | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select placeholder="Select a fruit"> | ||
| <div slot="label"> | ||
| Favorite Fruit | ||
| <ion-text color="danger">(Required)</ion-text> | ||
| </div> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| ``` |
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,23 @@ | ||
| ```tsx | ||
| import React from 'react'; | ||
| import { IonItem, IonList, IonSelect, IonSelectOption, IonText } from '@ionic/react'; | ||
|
|
||
| function Example() { | ||
| return ( | ||
| <IonList> | ||
| <IonItem> | ||
| <IonSelect placeholder="Select a Fruit"> | ||
| <div slot="label"> | ||
| Favorite Fruit | ||
| <IonText color="danger">(Required)</IonText> | ||
| </div> | ||
| <IonSelectOption value="apple">Apple</IonSelectOption> | ||
| <IonSelectOption value="banana">Banana</IonSelectOption> | ||
| <IonSelectOption value="orange">Orange</IonSelectOption> | ||
| </IonSelect> | ||
| </IonItem> | ||
| </IonList> | ||
| ); | ||
| } | ||
| 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,26 @@ | ||
| ```html | ||
| <template> | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select placeholder="Select a fruit"> | ||
| <div slot="label"> | ||
| Favorite Fruit | ||
| <ion-text color="danger">(Required)</ion-text> | ||
| </div> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { IonItem, IonList, IonSelect, IonSelectOption, IonText } from '@ionic/vue'; | ||
| import { defineComponent } from 'vue'; | ||
|
|
||
| export default defineComponent({ | ||
| components: { IonItem, IonList, IonSelect, IonSelectOption, IonText }, | ||
| }); | ||
| </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,11 @@ | ||
| ```html | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select aria-label="Favorite Fruit" value="apple"> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| ``` |
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,30 @@ | ||
| <!DOCTYPE html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>select</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" /> | ||
| </head> | ||
|
|
||
| <body> | ||
| <ion-app> | ||
| <ion-content> | ||
| <div class="container"> | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select aria-label="Favorite Fruit" value="apple"> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| </div> | ||
| </ion-content> | ||
| </ion-app> | ||
| </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,13 @@ | ||
| import Playground from '@site/src/components/global/Playground'; | ||
|
|
||
| import javascript from './javascript.md'; | ||
| import react from './react.md'; | ||
| import vue from './vue.md'; | ||
| import angular from './angular.md'; | ||
|
|
||
| <Playground | ||
| version="7" | ||
| code={{ javascript, react, vue, angular }} | ||
| src="usage/v7/select/no-visible-label/demo.html" | ||
| size="300px" | ||
| /> |
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,11 @@ | ||
| ```html | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select aria-label="Favorite Fruit" value="apple"> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| ``` |
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,19 @@ | ||
| ```tsx | ||
| import React from 'react'; | ||
| import { IonItem, IonList, IonSelect, IonSelectOption, IonText } from '@ionic/react'; | ||
|
|
||
| function Example() { | ||
| return ( | ||
| <IonList> | ||
| <IonItem> | ||
| <IonSelect aria-label="Favorite Fruit" value="apple"> | ||
| <IonSelectOption value="apple">Apple</IonSelectOption> | ||
| <IonSelectOption value="banana">Banana</IonSelectOption> | ||
| <IonSelectOption value="orange">Orange</IonSelectOption> | ||
| </IonSelect> | ||
| </IonItem> | ||
| </IonList> | ||
| ); | ||
| } | ||
| 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,22 @@ | ||
| ```html | ||
| <template> | ||
| <ion-list> | ||
| <ion-item> | ||
| <ion-select aria-label="Favorite Fruit" value="apple"> | ||
| <ion-select-option value="apple">Apple</ion-select-option> | ||
| <ion-select-option value="banana">Banana</ion-select-option> | ||
| <ion-select-option value="orange">Orange</ion-select-option> | ||
| </ion-select> | ||
| </ion-item> | ||
| </ion-list> | ||
| </template> | ||
|
|
||
| <script lang="ts"> | ||
| import { IonItem, IonList, IonSelect, IonSelectOption, IonText } from '@ionic/vue'; | ||
| import { defineComponent } from 'vue'; | ||
|
|
||
| export default defineComponent({ | ||
| components: { IonItem, IonList, IonSelect, IonSelectOption, IonText }, | ||
| }); | ||
| </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.