Skip to content
Draft
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
9 changes: 9 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,13 @@ module.exports = {
...ionicConfig,
// Override the trailingComma setting to avoid trailing commas in function arguments and JSX props.
trailingComma: 'es5',
overrides: [
...ionicConfig.overrides,
{
files: ['*.md', '*.mdx'],
// GitHub alerts such as `> [!NOTE]` need the marker on its own line.
excludeFiles: ['CONTRIBUTING.md'],
options: { proseWrap: 'never' },
},
],
};
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ Content
:::
```

Keep the blank lines after the opening marker, before the closing `:::`, and after it. `npm run lint` puts each paragraph on one line, so without them it merges the markers into the surrounding text and the admonition renders as plain text.

### Links and Headings

Use Markdown for links and headings whenever possible. When you need JSX, such as inside a component prop or in `src/`, use the Docusaurus components instead of raw HTML:
Expand Down
8 changes: 4 additions & 4 deletions docs/angular/lifecycle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ This guide covers how the page life cycle works in an app built with Ionic and A

Ionic embraces the life cycle events provided by Angular. The two Angular events you will find using the most are:

| Event Name | Description |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ngOnInit` | Fired once during component initialization. This event can be used to initialize local members and make calls into services that only need to be done once. |
| `ngOnDestroy` | Fired right before Angular destroys the view. Useful for cleanup like unsubscribing from observables. |
| Event Name | Description |
| --- | --- |
| `ngOnInit` | Fired once during component initialization. This event can be used to initialize local members and make calls into services that only need to be done once. |
| `ngOnDestroy` | Fired right before Angular destroys the view. Useful for cleanup like unsubscribing from observables. |

For more info on the Angular Component Life Cycle events, visit their [component lifecycle docs](https://angular.io/guide/lifecycle-hooks).

Expand Down
28 changes: 14 additions & 14 deletions docs/angular/platform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ export class MyPage {

### `is` {/* #is */}

| | |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| | |
| --- | --- |
| **Description** | Depending on the platform the user is on, `is(platformName)` will return true or false. Note that the same app can return true for more than one platform name. For example, an app running from an iPad would return true for the platform names: `mobile`, `ios`, `ipad`, and `tablet`. Additionally, if the app was running from Cordova then `cordova` would be true. |
| **Signature** | `is(platformName: Platforms) => boolean` |
| **Signature** | `is(platformName: Platforms) => boolean` |

#### Parameters {/* #parameters */}

| Name | Type | Description |
| -------------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| --- | --- | --- |
| `platformName` | `Platforms` | Name of the platform. Available options are android, capacitor, cordova, desktop, electron, hybrid, ios, ipad, iphone, mobile, phablet, pwa, tablet |

#### Platforms {/* #platforms */}
Expand Down Expand Up @@ -181,24 +181,24 @@ type PlatformConfig = {

### `platforms` {/* #platforms-1 */}

| | |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| | |
| --- | --- |
| **Description** | Depending on what device you are on, `platforms` can return multiple values. Each possible value is a hierarchy of platforms. For example, on an iPhone, it would return `mobile`, `ios`, and `iphone`. |
| **Signature** | `platforms() => string[]` |
| **Signature** | `platforms() => string[]` |

### `ready` {/* #ready */}

| | |
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| | |
| --- | --- |
| **Description** | Returns a promise when the platform is ready and native functionality can be called. If the app is running from within a web browser, then the promise will resolve when the DOM is ready. When the app is running from an application engine such as Cordova, then the promise will resolve when Cordova triggers the `deviceready` event. The resolved value is the `readySource`, which states the platform that was used. <br /><br />For example, when Cordova is ready, the resolved ready source is `cordova`. The default ready source value will be `dom`. The `readySource` is useful if different logic should run depending on the platform the app is running from. For example, only Capacitor and Cordova can execute the status bar plugin, so the web should not run status bar plugin logic. |
| **Signature** | `ready() => Promise<string>` |
| **Signature** | `ready() => Promise<string>` |

### `isRTL` {/* #isrtl */}

| | |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| | |
| --- | --- |
| **Description** | Returns if this app is using right-to-left language direction or not. We recommend the app's `index.html` file already has the correct `dir` attribute value set, such as `<html dir="ltr">` or `<html dir="rtl">`. [W3C: Structural markup and right-to-left text in HTML](http://www.w3.org/International/questions/qa-html-dir) |
| **Signature** | `isRTL() => boolean` |
| **Signature** | `isRTL() => boolean` |

### `isLandscape` {/* #islandscape */}

Expand Down
3 changes: 1 addition & 2 deletions docs/angular/pwa.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ sidebar_label: Progressive Web Apps

The two main requirements of a PWA are a [Service Worker](https://developers.google.com/web/fundamentals/primers/service-workers/) and a [Web Manifest](https://developers.google.com/web/fundamentals/web-app-manifest/). While it's possible to add both of these to an app manually, the Angular team has an `@angular/pwa` package that can be used to automate this.

The `@angular/pwa` package will automatically add a service worker and an app manifest to the app.
To add this package to the app, run:
The `@angular/pwa` package will automatically add a service worker and an app manifest to the app. To add this package to the app, run:

```shell
ng add @angular/pwa
Expand Down
3 changes: 1 addition & 2 deletions docs/angular/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ If you're looking for a high-level overview of what Ionic Angular is and how it

## Prerequisites {/* #prerequisites */}

Before you begin, make sure you have Node.js and npm installed on your machine.
You can check by running:
Before you begin, make sure you have Node.js and npm installed on your machine. You can check by running:

```shell
node -v
Expand Down
10 changes: 5 additions & 5 deletions docs/angular/slides.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,11 @@ To set these options as properties directly on `<swiper-container>` we would do

Below is a full list of property changes when going from `ion-slides` to Swiper Element:

| Name | Notes |
| ------- | --------------------------------------------------------------------------------------------------------------------------------------- |
| options | Set each option as a property directly on the `<swiper-container>` component. |
| mode | For different styles based upon the mode, you can target the slides with `.ios swiper-container` or `.md swiper-container` in your CSS. |
| pager | Use the `pagination` property instead. |
| Name | Notes |
| --- | --- |
| options | Set each option as a property directly on the `<swiper-container>` component. |
| mode | For different styles based upon the mode, you can target the slides with `.ios swiper-container` or `.md swiper-container` in your CSS. |
| pager | Use the `pagination` property instead. |

:::note

Expand Down
4 changes: 4 additions & 0 deletions docs/angular/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ The generated `package.json` includes scripts for running them:
| `npm run test:e2e` | Runs the end-to-end tests, starting the dev server for them. |

:::note

Playwright downloads its browsers separately from the npm package. Run `npx playwright install` once before running the end-to-end tests for the first time.

:::

## Testing Principles {/* #testing-principles */}
Expand Down Expand Up @@ -404,7 +406,9 @@ export class TabsPage {
```

:::note

Ionic keeps pages in the navigation stack, and tabs that have been visited, in the DOM after navigating away from them, hiding them instead of removing them. Use `filter({ visible: true })` when the same element, such as `ion-title`, can appear on more than one page.

:::

#### Testing Scripts {/* #testing-scripts */}
Expand Down
18 changes: 9 additions & 9 deletions docs/api/accordion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,15 +179,15 @@ import AccessibilityAnimations from '@site/static/usage/v9/accordion/accessibili

When used inside an `ion-accordion-group`, `ion-accordion` has full keyboard support for interacting with the component. The following table details what each key does:

| Key | Description |
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <kbd>Space</kbd> or <kbd>Enter</kbd> | When focus is on the accordion header, the accordion will collapse or expand depending on the state of the component. |
| <kbd>Tab</kbd> | Moves focus to the next focusable element. |
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | Moves focus to the previous focusable element. |
| <kbd>Down Arrow</kbd> | - When focus is on an accordion header, moves focus to the next accordion header. <br />- When focus is on the last accordion header, moves focus to the first accordion header. |
| <kbd>Up Arrow</kbd> | - When focus is on an accordion header, moves focus to the previous accordion header. <br />- When focus is on the first accordion header, moves focus to the last accordion header. |
| <kbd>Home</kbd> | When focus is on an accordion header, moves focus to the first accordion header. |
| <kbd>End</kbd> | When focus is on an accordion header, moves focus to the last accordion header. |
| Key | Description |
| --- | --- |
| <kbd>Space</kbd> or <kbd>Enter</kbd> | When focus is on the accordion header, the accordion will collapse or expand depending on the state of the component. |
| <kbd>Tab</kbd> | Moves focus to the next focusable element. |
| <kbd>Shift</kbd> + <kbd>Tab</kbd> | Moves focus to the previous focusable element. |
| <kbd>Down Arrow</kbd> | - When focus is on an accordion header, moves focus to the next accordion header. <br />- When focus is on the last accordion header, moves focus to the first accordion header. |
| <kbd>Up Arrow</kbd> | - When focus is on an accordion header, moves focus to the previous accordion header. <br />- When focus is on the first accordion header, moves focus to the last accordion header. |
| <kbd>Home</kbd> | When focus is on an accordion header, moves focus to the first accordion header. |
| <kbd>End</kbd> | When focus is on an accordion header, moves focus to the last accordion header. |

## Performance {/* #performance */}

Expand Down
11 changes: 6 additions & 5 deletions docs/api/buttons.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ import Basic from '@site/static/usage/v9/buttons/basic/index.mdx';

Buttons can be positioned inside of the toolbar using a named slot. The below chart has a description of each slot.

| Slot | Description |
| ----------- | ------------------------------------------------------------------------------------------------------- |
| `start` | Positions to the `left` of the content in LTR, and to the `right` in RTL. |
| `end` | Positions to the `right` of the content in LTR, and to the `left` in RTL. |
| Slot | Description |
| --- | --- |
| `start` | Positions to the `left` of the content in LTR, and to the `right` in RTL. |
| `end` | Positions to the `right` of the content in LTR, and to the `left` in RTL. |
| `secondary` | Positions element to the `left` of the content in `ios` mode, and directly to the `right` in `md` mode. |
| `primary` | Positions element to the `right` of the content in `ios` mode, and to the far `right` in `md` mode. |
| `primary` | Positions element to the `right` of the content in `ios` mode, and to the far `right` in `md` mode. |

import Placement from '@site/static/usage/v9/buttons/placement/index.mdx';

Expand All @@ -63,6 +63,7 @@ This feature is only available for iOS.
:::

{/* Reuse the playground from the Title directory */}

import CollapsibleLargeTitleButtons from '@site/static/usage/v9/title/collapsible-large-title/buttons/index.mdx';

<CollapsibleLargeTitleButtons />
Expand Down
6 changes: 1 addition & 5 deletions docs/api/card.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ import EncapsulationPill from '@components/page/api/EncapsulationPill';

<EncapsulationPill type="shadow" />

Cards are containers that display content such as text, images, buttons, and lists.
A card can be a single component, but is often made up of a header, title, subtitle,
and content. Cards are broken up into several components to accommodate this structure:
[card header](./card-header), [card title](./card-title), [card subtitle](./card-subtitle),
and [card content](./card-content).
Cards are containers that display content such as text, images, buttons, and lists. A card can be a single component, but is often made up of a header, title, subtitle, and content. Cards are broken up into several components to accommodate this structure: [card header](./card-header), [card title](./card-title), [card subtitle](./card-subtitle), and [card content](./card-content).

## Basic Usage {/* #basic-usage */}

Expand Down
Loading
Loading