-
Notifications
You must be signed in to change notification settings - Fork 3.2k
docs(radio): add example for wrapping label text #4234
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
brandyscarney
merged 4 commits into
ionic-team:main
from
soundproofboot:radioLabelWrapExample
Aug 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
2a77aed
docs(radio): add example for wrapping label text
soundproofboot 4e03158
docs(radio): update wrapping example to include ion-text-wrap utility…
soundproofboot 3a4b4ed
docs(radio): small updates for wrapping demo
brandyscarney 69a4d2c
docs(radio): copy example to v7 docs
brandyscarney 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
9 changes: 9 additions & 0 deletions
9
static/usage/v8/radio/label-wrap/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,9 @@ | ||
```css | ||
ion-list { | ||
width: 250px; | ||
} | ||
|
||
ion-radio.wrapped::part(label) { | ||
text-wrap: wrap; | ||
} | ||
``` |
12 changes: 12 additions & 0 deletions
12
static/usage/v8/radio/label-wrap/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,12 @@ | ||
```html | ||
<ion-list> | ||
<ion-radio-group value="truncated"> | ||
<ion-item> | ||
<ion-radio value="truncated">Truncated with ellipsis by default</ion-radio> | ||
</ion-item> | ||
<ion-item> | ||
<ion-radio value="wrapped" class="wrapped">`text-wrap` applied to `label` shadow part</ion-radio> | ||
</ion-item> | ||
</ion-radio-group> | ||
</ion-list> | ||
``` |
12 changes: 12 additions & 0 deletions
12
static/usage/v8/radio/label-wrap/angular/example_component_ts.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,12 @@ | ||
```ts | ||
import { Component } from '@angular/core'; | ||
import { IonItem, IonList, IonRadio, IonRadioGroup } from '@ionic/angular/standalone'; | ||
|
||
@Component({ | ||
selector: 'app-example', | ||
templateUrl: 'example.component.html', | ||
styleUrls: ['example.component.css'], | ||
imports: [IonItem, IonList, IonRadio, IonRadioGroup], | ||
}) | ||
export class ExampleComponent {} | ||
``` |
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,41 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Radio</title> | ||
<link rel="stylesheet" href="../../common.css" /> | ||
<script src="../../common.js"></script> | ||
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@8/dist/ionic/ionic.esm.js"></script> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@8/css/ionic.bundle.css" /> | ||
|
||
<style> | ||
ion-list { | ||
width: 250px; | ||
} | ||
|
||
ion-radio.wrapped::part(label) { | ||
text-wrap: wrap; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<ion-app> | ||
<ion-content> | ||
<div class="container"> | ||
<ion-list> | ||
<ion-radio-group value="truncated"> | ||
<ion-item> | ||
<ion-radio value="truncated">Truncated with ellipsis by default</ion-radio> | ||
</ion-item> | ||
<ion-item> | ||
<ion-radio value="wrapped" class="wrapped">`text-wrap` applied to `label` shadow part</ion-radio> | ||
</ion-item> | ||
</ion-radio-group> | ||
</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,34 @@ | ||
import Playground from '@site/src/components/global/Playground'; | ||
|
||
import javascript from './javascript.md'; | ||
|
||
import react_main_tsx from './react/main_tsx.md'; | ||
import react_main_css from './react/main_css.md'; | ||
|
||
import vue from './vue.md'; | ||
|
||
import angular_example_component_html from './angular/example_component_html.md'; | ||
import angular_example_component_css from './angular/example_component_css.md'; | ||
import angular_example_component_ts from './angular/example_component_ts.md'; | ||
|
||
<Playground | ||
version="8" | ||
code={{ | ||
javascript, | ||
react: { | ||
files: { | ||
'src/main.tsx': react_main_tsx, | ||
'src/main.css': react_main_css, | ||
}, | ||
}, | ||
vue, | ||
angular: { | ||
files: { | ||
'src/app/example.component.html': angular_example_component_html, | ||
'src/app/example.component.css': angular_example_component_css, | ||
'src/app/example.component.ts': angular_example_component_ts, | ||
}, | ||
}, | ||
}} | ||
src="usage/v8/radio/label-wrap/demo.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,22 @@ | ||
```html | ||
<ion-list> | ||
<ion-radio-group value="truncated"> | ||
<ion-item> | ||
<ion-radio value="truncated">Truncated with ellipsis by default</ion-radio> | ||
</ion-item> | ||
<ion-item> | ||
<ion-radio value="wrapped" class="wrapped">`text-wrap` applied to `label` shadow part</ion-radio> | ||
</ion-item> | ||
</ion-radio-group> | ||
</ion-list> | ||
|
||
<style> | ||
ion-list { | ||
width: 250px; | ||
} | ||
|
||
ion-radio.wrapped::part(label) { | ||
text-wrap: wrap; | ||
} | ||
</style> | ||
``` |
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,9 @@ | ||
```css | ||
ion-list { | ||
width: 250px; | ||
} | ||
|
||
ion-radio.wrapped::part(label) { | ||
text-wrap: wrap; | ||
} | ||
``` |
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,24 @@ | ||
```tsx | ||
import React from 'react'; | ||
import { IonList, IonItem, IonRadio, IonRadioGroup } from '@ionic/react'; | ||
|
||
import './main.css'; | ||
|
||
function Example() { | ||
return ( | ||
<IonList> | ||
<IonRadioGroup value="truncated"> | ||
<IonItem> | ||
<IonRadio value="truncated">Truncated with ellipsis by default</IonRadio> | ||
</IonItem> | ||
<IonItem> | ||
<IonRadio value="wrapped" className="wrapped"> | ||
`text-wrap` applied to `label` shadow part | ||
</IonRadio> | ||
</IonItem> | ||
</IonRadioGroup> | ||
</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,33 @@ | ||
```html | ||
<template> | ||
<ion-list> | ||
<ion-radio-group value="truncated"> | ||
<ion-item> | ||
<ion-radio value="truncated">Truncated with ellipsis by default</ion-radio> | ||
</ion-item> | ||
<ion-item> | ||
<ion-radio value="wrapped" class="wrapped">`text-wrap` applied to `label` shadow part</ion-radio> | ||
</ion-item> | ||
</ion-radio-group> | ||
</ion-list> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import { IonList, IonItem, IonRadio, IonRadioGroup } from '@ionic/vue'; | ||
import { defineComponent } from 'vue'; | ||
|
||
export default defineComponent({ | ||
components: { IonList, IonItem, IonRadio, IonRadioGroup }, | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
ion-list { | ||
width: 250px; | ||
} | ||
|
||
ion-radio.wrapped::part(label) { | ||
text-wrap: wrap; | ||
} | ||
</style> | ||
``` |
Oops, something went wrong.
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.