Skip to content

chore: merge feature-7.2 docs #3051

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
merged 3 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/api/button.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ import CSSProps from '@site/static/usage/v7/button/theming/css-properties/index.

<CSSProps />

## Accessibility

Buttons are built to be accessible, but may need some adjustments depending on their content. The button component renders a native [button element](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button) which allows it to take advantage of the functionality that a native button provides.

### Overflowing Text Content

There are many cases where a button's text content may overflow the container. It is recommended to wrap the text inside of the button when this happens so that all of the text can still be read. The button component will automatically adjust its height to accommodate the extra lines of text.

The button text does not automatically wrap to the next line when the text is too long to fit. In order to make the text wrap, the `ion-text-wrap` class can be added, which will set the `white-space` property to `"normal"`. This will become the default in a future major release.

:::info
The `max-width` style is set on the button below for demo purposes only. Text wrapping will work with a dynamic button width.
:::

import TextWrapping from '@site/static/usage/v7/button/text-wrapping/index.md';

<TextWrapping />

## Properties
<Props />

Expand Down
14 changes: 14 additions & 0 deletions docs/reference/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,20 @@ title: Glossary

<div id="what-is">

<section id="a11y">
<a href="#a11y">
<h3>Accessibility</h3>
</a>
<p>
<a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility" target="_blank">
Accessibility
</a>{' '}
(a11y) is the practice of enabling as many people as possible to use the content, even if people have limited
abilities. This includes people with disabilities, those using mobile devices, and those with slow network
connections. Content should be developed to be as accessible as technology allows.
</p>
</section>

<section id="android-sdk">
<a href="#android-sdk">
<h3>Android SDK</h3>
Expand Down
7 changes: 7 additions & 0 deletions static/usage/v7/button/text-wrapping/angular.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```html
<ion-button>Default</ion-button>
<ion-button class="ion-text-wrap" style="max-width: 400px"
>This is the button that never ends it just goes on and on and on and on and on and on and on and on my
friends</ion-button
>
```
26 changes: 26 additions & 0 deletions static/usage/v7/button/text-wrapping/demo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Button</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-button>Default</ion-button>
<ion-button class="ion-text-wrap" style="max-width: 400px"
>This is the button that never ends it just goes on and on and on and on and on and on and on and on my
friends</ion-button
>
</div>
</ion-content>
</ion-app>
</body>
</html>
8 changes: 8 additions & 0 deletions static/usage/v7/button/text-wrapping/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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/button/text-wrapping/demo.html" />
7 changes: 7 additions & 0 deletions static/usage/v7/button/text-wrapping/javascript.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```html
<ion-button>Default</ion-button>
<ion-button class="ion-text-wrap" style="max-width: 400px"
>This is the button that never ends it just goes on and on and on and on and on and on and on and on my
friends</ion-button
>
```
16 changes: 16 additions & 0 deletions static/usage/v7/button/text-wrapping/react.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
```tsx
import React from 'react';
import { IonButton } from '@ionic/react';

function Example() {
return (
<>
<IonButton>Default</IonButton>
<IonButton className="ion-text-wrap" style={{ maxWidth: '400px' }}>
This is the button that never ends it just goes on and on and on and on and on and on and on and on my friends
</IonButton>
</>
);
}
export default Example;
```
18 changes: 18 additions & 0 deletions static/usage/v7/button/text-wrapping/vue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```html
<template>
<ion-button>Default</ion-button>
<ion-button class="ion-text-wrap" style="max-width: 400px"
>This is the button that never ends it just goes on and on and on and on and on and on and on and on my
friends</ion-button
>
</template>

<script lang="ts">
import { IonButton } from '@ionic/vue';
import { defineComponent } from 'vue';

export default defineComponent({
components: { IonButton },
});
</script>
```