Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
9c84110
chore(links): use Docusaurus Link and Heading instead of raw HTML (#4…
thetaPC Nov 4, 2026
e0c51a1
fix(theming): accept rgb() and hsl() values in the color generators (…
thetaPC Nov 4, 2026
de53f0d
chore(ci): build the site on Linux to catch wrong-case imports (#4823)
thetaPC Nov 4, 2026
1f413af
chore: clean up dependencies, spell check caching, and leftover marku…
thetaPC Nov 5, 2026
f04c928
chore(lint): enforce Docusaurus Link and Heading with ESLint (#4830)
thetaPC Nov 6, 2026
019986b
chore(deps): update dependency sass to v1.107.0 (#4818)
renovate[bot] Nov 6, 2026
7eefd7b
docs(contributing): update the contributing guide and playground docs…
thetaPC Nov 9, 2026
ef18970
chore(playground): load the latest published Ionic in demos for unrel…
thetaPC Nov 9, 2026
84e3886
chore(deps): update dependency cspell to v10.4.1 (#4835)
renovate[bot] Nov 10, 2026
3002e45
fix(seo): add descriptions to pages leaking heading ids into search r…
thetaPC Nov 10, 2026
e65feec
chore(styles): match Docusaurus' stylesheet layout (#4834)
thetaPC Nov 11, 2026
f487064
chore(deps): update dependency vite to v8.3.7 (#4839)
renovate[bot] Nov 12, 2026
5705e5d
chore(deps): update dependency eslint-plugin-mdx to v3.9.4 (#4838)
renovate[bot] Nov 12, 2026
96a96ff
chore(deps): update dependency vue to v3.5.45 (#4841)
renovate[bot] Nov 12, 2026
f365b3a
docs(vue): import ionicons after @ionic/vue in the Your First App sni…
brandyscarney Nov 12, 2026
851f11b
chore: lint JSDoc comments, fold ESLint into lint, and use camelCase …
thetaPC Nov 13, 2026
d75247e
chore(deps): update dependency eslint-plugin-jsdoc to v65.4.5 (#4847)
renovate[bot] Nov 13, 2026
f36e5b6
chore(deps): update dependency docusaurus-plugin-copy-page-button to …
renovate[bot] Nov 13, 2026
1f14268
chore(deps): update dependency vite to v8.3.7 (#4840)
renovate[bot] Nov 13, 2026
b494861
docs(badge): register icons in the JavaScript tab bar playground (#4848)
brandyscarney Nov 13, 2026
eea599e
chore(deps): update dependency @prismicio/client to v7.23.1 (#4852)
renovate[bot] Nov 17, 2026
2ab78b4
chore(deps): update dependency eslint-plugin-jsdoc to v65.4.7 (#4853)
renovate[bot] Nov 17, 2026
627edfb
docs: fix a mistyped palette link and the Capacitor Cordova plugins l…
farisbasha Nov 17, 2026
4262197
chore(deps): update ionic to v9.0.11 (#4855)
renovate[bot] Nov 17, 2026
831f751
chore(deps): update dependency eslint-plugin-mdx to v3.9.5 (#4854)
renovate[bot] Nov 17, 2026
33fee20
chore(deps): update typescript-eslint monorepo to v8.72.2 (#4856)
renovate[bot] Nov 17, 2026
65fa09c
chore(deps): update vite-vue (#4857)
renovate[bot] Nov 17, 2026
a799187
chore(v8): pin an explicit id on every v8 heading (#4832)
thetaPC Nov 17, 2026
d2c1393
chore(deps): update ionic (#4868)
renovate[bot] Nov 18, 2026
86724de
chore(deps): update dependency @crowdin/cli to v5.6.0 (#4869)
renovate[bot] Nov 18, 2026
18433d2
chore(deps): update dependency cspell to v10.5.1 (#4870)
renovate[bot] Nov 18, 2026
36bc4cc
chore(deps): update dependency eslint to v10.15.0 (#4871)
renovate[bot] Nov 18, 2026
5c13c34
chore(i18n): sync main into translation/jp
thetaPC Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ jobs:
exit 1
fi
- uses: ./.github/workflows/actions/check-translations
# Vercel builds on Linux, where imports are case-sensitive. No other check
# resolves the imports in doc pages, so an import with the wrong casing only
# fails when the site is built.
- name: 🏗️ Build
run: |
npm run generate-markdown
npm run build:preview
env:
# The release notes page reads releases from the GitHub API, and the
# script fails in CI without a token.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

cross-platform:
name: Cross-platform on ${{ matrix.os }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
# Generated files
.docusaurus
.cache-loader
.eslintcache
.cspellcache
src/components/page/reference/ReleaseNotes/release-notes.json

# Misc
Expand Down
131 changes: 114 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ Thanks for your interest in contributing to Ionic's documentation! :tada: Check

- [Development Workflow](#development-workflow)
- [Previewing Changes](#previewing-changes)
- [Checking Links](#checking-links)
- [Linting Documentation](#linting-documentation)
- [Spell Check](#spell-check)
- [Heading IDs](#heading-ids)
- [Using VS Code on Windows](#using-vs-code-on-windows)
- [Project Structure](#project-structure)
- [Directories](#directories)
- [Authoring Content](#authoring-content)
- [Admonitions](#admonitions)
- [Links and Headings](#links-and-headings)
- [Playgrounds](#playgrounds)
- [Reference Content](#reference-content)
- [Translation](#translation)
- [Reporting Issues](#reporting-issues)
Expand All @@ -28,16 +33,16 @@ Thanks for your interest in contributing to Ionic's documentation! :tada: Check

### Previewing Changes

In order to run the documentation locally, install the dependencies and run the development server:
In order to run the documentation locally, use Node.js 24 or later, install the dependencies and run the development server:

```sh
npm install
npm ci
npm start
```

#### GitHub Token

The documentation build requires a GitHub Personal Access Token to fetch Ionic Framework release notes. The build will still work locally without it (release notes will be empty), but it's required for Vercel preview and production builds.
The documentation build requires a GitHub Personal Access Token to fetch Ionic Framework release notes. The build still works locally without it, with an empty release notes page, but Vercel preview and production builds fail without it.

**Local Development:**

Expand Down Expand Up @@ -69,11 +74,21 @@ The documentation build requires a GitHub Personal Access Token to fetch Ionic F

3. Redeploy the project for the token to take effect

Without the token, the build will fail with an error message indicating the token is missing.
If the token is missing, Vercel builds fail with `GITHUB_TOKEN environment variable is required.`

### Checking Links

The development server does not check for broken links or anchors. Only a build does, and it fails on any it finds. Build the site before pushing a change that adds or moves links or headings:

```sh
npm run build:preview
```

This builds the English site only, the same build as a Vercel preview.

### Linting Documentation

This repository uses [Prettier](https://prettier.io/), an opinionated code formatter, in order to keep consistent formatting throughout the documentation. Run the following command to automatically fix all formatting, and then push any changes:
This repository uses [ESLint](https://eslint.org/) to catch markup the build cannot check, such as raw links and headings and misaligned JSDoc comments, and [Prettier](https://prettier.io/), an opinionated code formatter, to keep consistent formatting throughout the documentation. Run the following command to report ESLint errors and automatically fix all formatting, and then push any changes:

```
npm run lint
Expand Down Expand Up @@ -107,7 +122,7 @@ npm run spellcheck
```mdx
{/* cspell:disable */}

<p>Everything inside of these comments will be ignored by the spell checkr. Proofread your own words carefully.</p>
<p>Everything inside of these comments will be ignored by the spell checker. Proofread your own words carefully.</p>

{/* cspell:enable */}
```
Expand All @@ -124,11 +139,25 @@ Comments disabling the next line or entire sections of documentation are useful

In general, we should try to avoid ignoring words unless they are technical terms that are used throughout the documentation and wouldn't necessarily make sense formatted as code.

### Heading IDs

Every heading in `docs/` needs an explicit ID, so that renaming the heading doesn't change its anchor and break links to it:

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

Run the following command to add IDs to any new headings, and then push the changes. CI fails if a heading is missing one.

```
npm run heading-ids
```

---

## Using VS Code on Windows

The Ionic docs were originally built in a Mac-based environment, so Mac-focused linting rules apply when committing changes. To contribute on Windows, do the following:
Prettier expects LF line endings, and CI fails if `npm run lint` changes any file. To contribute on Windows, do the following:

- Configure VS Code to read/save files using line breaks (LF) instead of carriage returns (CRLF). Set it globally by navigating to: Settings -> Text Editor -> Files -> Eol. Set to `\n`.
- Check that the Git setting `core.autocrlf` is set to `false`: run `git config -l | grep autocrlf`. Switch it to false using: `git config --global core.autocrlf false`.
Expand All @@ -140,14 +169,19 @@ Ionic's documentation is built using [Docusaurus](https://docusaurus.io/). The c

### Directories

- `_templates/` - templates used by `npm run playground:new`
- `docs/` - content of the current version of the docs
- `plugins/` - local Docusaurus plugins, such as the one that generates the component API pages
- `scripts/` - build scripts used to generate markdown or json files
- `src/` - source code and content of the docs
- `src/` - source code of the site
- `components/` - components used across the site
- `global/` - components used globally
- `page/` - components used on a single page or in a limited scope
- `styles/` - global styles and variables
- `components/` - styles split out into the components they target
- `theme/` - Docusaurus theme components that have been swizzled
- `static/`
- `code/` - StackBlitz project templates used by the playgrounds
- `demos/` - self-contained demos, optionally presented by pages via `demoUrl` YAML frontmatter
- `usage/` - playgrounds that can be created by running `npm run playground:new` [(docs)](_templates/README.md#new-playground-template)
- `versioned_docs/` - versions of the docs created by the docusaurus versioning command
Expand All @@ -158,22 +192,81 @@ Ionic's documentation is built using [Docusaurus](https://docusaurus.io/). The c
The content of the Ionic docs is written as [Markdown](https://commonmark.org/) in `docs/`. Each Markdown file corresponds to a route unless explicitly changed in the frontmatter.

```
/docs/ => src/pages/index.md
/docs/intro/cli => src/pages/intro/cli.md
/docs/theming/advanced => src/pages/theming/advanced.md
/docs/theming => src/pages/theming.md
/docs => docs/index.mdx
/docs/intro/cli => docs/intro/cli.mdx
/docs/theming/basics => docs/theming/basics.mdx
/docs/v8/intro/cli => versioned_docs/version-v8/intro/cli.mdx
```

`/docs` maps to `docs/index.mdx` through `slug: /` in its frontmatter. Older versions live in `versioned_docs/` and are served under their version, such as `/docs/v8/`.

Versions listed in [`versions.json`](versions.json) are actively maintained. If your change also applies to one of them, make the same change in its `versioned_docs/version-<name>/` folder. Versions listed in [`versionsArchived.json`](versionsArchived.json) are frozen deployments that are no longer built, so changes to their folders never reach the site.

Markdown links resolve within their own version, but JSX paths such as `<Link to>` and `useBaseUrl` do not. In an older version, prefix them with the version, such as `<Link to="/v8/api/note">`.

You can make copy edits to the site by [editing the Markdown files directly on GitHub](https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files). In your pull request, please explain what was missing from or inaccurate about the content.

### Admonitions

Give an admonition a title with square brackets. The older `:::note My Title` form renders as plain text with no build error, so CI fails on it:

```mdx
:::note[My Title]

Content

:::
```

You can make copy edits to the site by [editing the Markdown files directly on GitHub](https://help.github.com/articles/editing-files-in-another-user-s-repository/). In your pull request, please explain what was missing from or inaccurate about the content.
### 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:

- [`<Link>`](https://docusaurus.io/docs/docusaurus-core#link) from `@docusaurus/Link` instead of `<a>`. It handles the base URL and locale, and opens external URLs in a new tab with `rel="noopener noreferrer"`.
- [`<Heading>`](https://docusaurus.io/docs/api/misc/@docusaurus/eslint-plugin/prefer-docusaurus-heading) from `@theme/Heading` instead of `<h2>` to `<h6>`.

The build only checks links and anchors that go through Markdown or these components. A raw `<a href>` to a page that doesn't exist builds without errors, and a raw heading's `id` can't be used as a link target.

Markup inside code samples is exempt, since it's example code rather than part of the page. CI fails on a raw `<a>` or heading anywhere else. To check before pushing, run:

```
npm run lint
```

### Playgrounds

A playground is the interactive example on a component page. It shows a live demo that switches between iOS and Material Design modes, the code for JavaScript, Angular, React and Vue, and a button to open the example in StackBlitz.

Each playground is a folder in `static/usage/<version>/<component>/<example>/`:

- `demo.html`: the live demo, so update it along with the framework code
- `javascript.md`, `react.md`, `vue.md` and `angular/`: the code shown for each framework
- `index.mdx`: renders the `Playground` component with those files

Run the following command to generate a playground, and then import its `index.mdx` into the page:

```
npm run playground:new
```

```mdx
import Basic from '@site/static/usage/v9/button/basic/index.mdx';

<Basic />
```

For the generator's prompts, refer to the [playground template docs](_templates/README.md#new-playground-template). For the `Playground` options, refer to its [README](src/components/global/Playground/README.md).

### Reference Content

The Markdown in `docs/` does not only contain manually written markdown files:

- Paths matching `/docs/api/*` are built from the [Ionic Framework](https://github.com/ionic-team/ionic) source code
- Paths matching `/docs/native/*` are built from the [Ionic Native](https://github.com/ionic-team/ionic-native) source code
- The properties, events, methods, and other API tables on `/docs/api/*` pages are built from the [Ionic Framework](https://github.com/ionic-team/ionic-framework) source code
- Paths matching `/docs/native/*` are built from the [Capacitor plugins](https://github.com/ionic-team/capacitor-plugins) READMEs
- Paths matching `/docs/cli/commands/*` are built from the [Ionic CLI](https://github.com/ionic-team/ionic-cli) source code

The `native/` and `cli/commands/` pages are generated when you run `npm start` or build the site, and they are not committed. To change them, edit the plugin's README in [capacitor-plugins](https://github.com/ionic-team/capacitor-plugins) or the command's source in [ionic-cli](https://github.com/ionic-team/ionic-cli).

## Translation

The Ionic docs have been translated into Japanese and are in the process of being translated into Chinese, French, Portuguese, and Spanish. We've chosen these languages because we believe they have the greatest number of developers where English-only documentation would be a barrier.
Expand All @@ -184,7 +277,7 @@ _Please submit translation issues to the Crowdin page and not the Ionic Docs Git

<!-- cspell:disable-next-line -->

The Japanese translation of the docs were built by an independent team, lead by [rdlabo](https://github.com/rdlabo) and can be found and contributed to on the [ionic-jp group's `ionic-docs` project page](https://github.com/ionic-jp/ionic-docs).
The Japanese translation of the docs were built by an independent team, led by [rdlabo](https://github.com/rdlabo) and can be found and contributed to on the [ionic-jp group's `ionic-docs` project page](https://github.com/ionic-jp/ionic-docs).

## Reporting Issues

Expand All @@ -195,7 +288,7 @@ If the issue you're reporting is a bug, please be sure it is an issue with the I
- Steps to reproduce
- Expected behavior
- OS and browser versions
- If possible, a demo repo or CodePen/CodeSandbox
- If possible, a demo repo or StackBlitz

> [!NOTE]
> Some [reference content](#reference-content) is pulled from other Ionic repos. In that case, please submit your issue on the docs repo with a link to the repo where the content lives.
Expand All @@ -206,6 +299,10 @@ If the issue you're reporting is a bug, please be sure it is an issue with the I

When submitting pull requests, please keep the scope of your change contained to a single feature or bug. When in doubt, err on the side of smaller pull requests. If your pull request is a new feature, we would recommend opening an issue first to come to an agreement about the feature before putting in significant time.

Title your pull request in the [Conventional Commits](https://www.conventionalcommits.org/) format, such as `docs(button): add an icon-only example`. Pull requests are squash merged, so the title becomes the commit message on `main`.

Each pull request gets a Vercel preview deployment. Use it to check your change on the built site.

---

## Deploying
Expand Down
13 changes: 8 additions & 5 deletions _templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ Some helpful docs links for updating/creating templates:

## Generation

To create a new playground, run `npm run playground:new`. This will walk you through some prompts to decide what files for the generator to create for the playground, and what their paths should be.
To create a new playground, run `npm run playground:new`. This will walk you through some prompts to decide what files for the generator to create for the playground, and what their paths should be:

The path defaults to `basic`. If there is already a basic playground, you'll want to input a different path for the playground.

The CSS option will add extra files if you need to include custom CSS in your playground.
- **Component or guide:** a component playground goes under the component's name, such as `button`. Any other playground goes under a guide section, such as `animations`, and starts with an `ion-card`.
- **Path:** the folder for the playground under that name, such as `basic` or `theming/colors`. Use `basic` for a component's first playground.
- **Version:** the Ionic Framework version the playground is for.
- **CSS:** adds extra files if you need to include custom CSS in your playground.

If you need a component for multiple versions of Ionic Framework, you (currently) need to run the generator once for each version.

If the version you pick is not published to npm yet, such as the next major on a major branch, the generated `demo.html` loads the latest published version from the CDN instead, since the CDN has nothing to serve for an unpublished version. The demo renders, but APIs new in that version do not work in it until the version is published. The generator also adds a `TODO(FW-XXXX)` comment above the CDN links. Replace `FW-XXXX` with the ticket that tracks the update, and create one if it does not exist yet.

## Usage

Once you've generated your playground, you need to add it to the main markdown file in the docs (e.g. [docs/api/button.mdx](../docs/api/button.mdx)) by doing something similar to the following example:
Once you've generated your playground, you need to add it to the main markdown file in the docs (e.g. [docs/api/button.mdx](../docs/api/button.mdx)). The generator prints the snippet to paste when it finishes, which looks similar to the following example:

```
## Feature
Expand Down
7 changes: 4 additions & 3 deletions _templates/playground/new/demo.html.ejs.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ to: "<%= `static/usage/v${version}/${name}/${path}/demo.html` %>"
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title><%= h.changeCase.titleCase(name) %></title>
<link rel="stylesheet" href="<%= directoryChanges %>../../common.css" />
<script src="<%= directoryChanges %>../../common.js"></script>
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@<%= version %>/dist/ionic/ionic.esm.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@<%= version %>/css/ionic.bundle.css" /><% if (css){ %>
<script src="<%= directoryChanges %>../../common.js"></script><% if (cdnVersion !== version) { %>
<!-- TODO(FW-XXXX): load Ionic <%= version %> once it is published --><% } %>
<script type="module" src="https://cdn.jsdelivr.net/npm/@ionic/core@<%= cdnVersion %>/dist/ionic/ionic.esm.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@ionic/core@<%= cdnVersion %>/css/ionic.bundle.css" /><% if (css){ %>

<style>
<%= component %> {
Expand Down
40 changes: 39 additions & 1 deletion _templates/playground/new/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,41 @@
const changeCase = require('change-case');

/**
* Returns the major version of Ionic for the demo to load from the CDN.
*
* The CDN only serves published versions, so a playground for a major that
* is not published yet loads the latest published one instead. Otherwise
* the demo requests a version that does not exist and renders nothing. With
* the fallback the demo renders, but APIs new in that major do not work in
* it until the major is published.
*/
const getCdnVersion = async (version) => {
try {
const response = await fetch('https://registry.npmjs.org/-/package/@ionic/core/dist-tags', {
signal: AbortSignal.timeout(5000),
});
const { latest } = await response.json();
const latestMajor = parseInt(latest, 10);

if (Number.isNaN(latestMajor)) {
throw new Error(`Unexpected latest version: ${latest}`);
}

if (Number(version) > latestMajor) {
console.log(
`\nIonic ${version} is not published yet, so the demo loads Ionic ${latestMajor} from the CDN and APIs new in Ionic ${version} will not work in it. Update the version in demo.html once Ionic ${version} is published, and replace FW-XXXX in its TODO with the ticket that tracks the update, creating one if it does not exist yet.`
);
return String(latestMajor);
}
} catch (error) {
console.warn(
`\nCould not check the published Ionic versions, so the demo loads Ionic ${version} from the CDN. If that version is not published yet, change it in demo.html.`
);
}

return version;
};

// see types of prompts:
// https://github.com/enquirer/enquirer/tree/master/examples
//
Expand Down Expand Up @@ -63,13 +99,15 @@ module.exports = {
message: 'Generate custom CSS files?',
},
])
.then((answers) => {
.then(async (answers) => {
answers.name = answers.name || answers.component.replace('ion-', '');

// if the playground is not for a component,
// include an ion-card in the playground
answers.component = answers.component || 'ion-card';

answers.cdnVersion = await getCdnVersion(answers.version);

const playgroundName = changeCase.pascal(answers.path.split('/').pop());
console.log(
`\nTo use this playground in a docs markdown file, include\nthe following:\n\n## ${playgroundName}\n\nimport ${playgroundName} from '@site/static/usage/v${answers.version}/${answers.name}/${answers.path}/index.mdx';\n\n<${playgroundName} />\n`
Expand Down
Loading
Loading