diff --git a/docs/api/checkbox.md b/docs/api/checkbox.md
index fdfbe1c8a48..c43a878a0ce 100644
--- a/docs/api/checkbox.md
+++ b/docs/api/checkbox.md
@@ -29,15 +29,27 @@ import Basic from '@site/static/usage/v7/checkbox/basic/index.md';
## Label Placement
-Developers can use the `labelPlacement` property to control how the label is placed relative to the control.
+Developers can use the `labelPlacement` property to control how the label is placed relative to the control. This property mirrors the flexbox `flex-direction` property.
import LabelPlacement from '@site/static/usage/v7/checkbox/label-placement/index.md';
+## Alignment
+
+Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property.
+
+:::note
+Stacked checkboxes can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally.
+:::
+
+import Alignment from '@site/static/usage/v7/checkbox/alignment/index.md';
+
+
+
## Justification
-Developers can use the `justify` property to control how the label and control are packed on a line.
+Developers can use the `justify` property to control how the label and control are packed on a line. This property mirrors the flexbox `justify-content` property.
import Justify from '@site/static/usage/v7/checkbox/justify/index.md';
diff --git a/docs/api/datetime.md b/docs/api/datetime.md
index c166841c37a..aca72185d7c 100644
--- a/docs/api/datetime.md
+++ b/docs/api/datetime.md
@@ -37,6 +37,7 @@ import HighlightedDatesCallback from '@site/static/usage/v7/datetime/highlighted
import MultipleDateSelection from '@site/static/usage/v7/datetime/multiple/index.md';
import GlobalTheming from '@site/static/usage/v7/datetime/styling/global-theming/index.md';
+import CalendarDaysStyling from '@site/static/usage/v7/datetime/styling/calendar-days/index.md';
import WheelStyling from '@site/static/usage/v7/datetime/styling/wheel-styling/index.md';
@@ -50,7 +51,7 @@ import EncapsulationPill from '@components/page/api/EncapsulationPill';
Datetimes present a calendar interface and time wheel, making it easy for users to select dates and times. Datetimes are similar to the native `input` elements of `datetime-local`, however, Ionic Framework's Datetime component makes it easy to display the date and time in the preferred format, and manage the datetime values.
-## Overview
+## Overview
Historically, handling datetime values within JavaScript, or even within HTML
inputs, has always been a challenge. Specifically, JavaScript's `Date` object is
@@ -98,13 +99,17 @@ While seconds, milliseconds, and time zone can be specified using the ISO 8601 d
If you need to present a datetime in an overlay such as a modal or a popover, we recommend using [ion-datetime-button](./datetime-button). `ion-datetime-button` should be used when space is constrained. This component displays buttons which show the current date and time values. When the buttons are tapped, the date or time pickers open in the overlay.
+## Setting Values Asynchronously
+
+If its `value` is updated programmatically after a datetime has already been created, the datetime will automatically jump to the new date. However, it is recommended to avoid updating the `value` in this way when users are able to interact with the datetime, as this could be disorienting for those currently trying to select a date. For example, if a datetime's `value` is loaded by an asynchronous process, it is recommended to hide the datetime with CSS until the value has finished updating.
+
## Date Constraints
### Max and Min Dates
To customize the minimum and maximum datetime values, the `min` and `max` component properties can be provided which may make more sense for the app's use-case. Following the same IS0 8601 format listed in the table above, each component can restrict which dates can be selected by the user.
-The following example restricts date selection to March 2022 through May 2022 only.
+The following example restricts date selection to March 2022 through May 2022 only.
@@ -118,7 +123,7 @@ The following example allows minutes to be selected in increments of 15. It also
### Advanced Date Constraints
-With the `isDateEnabled` property, developers can customize the `ion-datetime` to disable a specific day, range of dates, weekends or any custom rule using an ISO 8601 date string.
+With the `isDateEnabled` property, developers can customize the `ion-datetime` to disable a specific day, range of dates, weekends or any custom rule using an ISO 8601 date string.
The `isDateEnabled` property accepts a function returning a boolean, indicating if a date is enabled. The function is called for each rendered calendar day, for the previous, current and next month. Custom implementations should be optimized for performance to avoid jank.
The following example shows how to disable all weekend dates. For more advanced date manipulation, we recommend using a date utility such as `date-fns`.
@@ -321,6 +326,16 @@ The benefit of this approach is that every component, not just `ion-datetime`, c
+### Calendar Days
+
+The calendar days in a grid-style `ion-datetime` can be styled using CSS shadow parts.
+
+:::note
+The example below selects the day 2 days ago, unless that day is in the previous month, then it selects a day 2 days in the future. This is done for demo purposes in order to show how to apply custom styling to all days, the current day, and the selected day.
+:::
+
+
+
### Wheel Pickers
The wheels used in `ion-datetime` can be styled through a combination of shadow parts and CSS variables. This applies to both the columns in wheel-style datetimes, and the month/year picker in grid-style datetimes.
@@ -363,7 +378,7 @@ import { format, parseISO } from 'date-fns';
/**
* This is provided in the event
* payload from the `ionChange` event.
- *
+ *
* The value is an ISO-8601 date string.
*/
const dateFromIonDatetime = '2021-06-04T14:23:00-04:00';
diff --git a/docs/api/radio.md b/docs/api/radio.md
index c9b659ed8aa..9473c5cc790 100644
--- a/docs/api/radio.md
+++ b/docs/api/radio.md
@@ -30,21 +30,32 @@ import Basic from '@site/static/usage/v7/radio/basic/index.md';
## Label Placement
-Developers can use the `labelPlacement` property to control how the label is placed relative to the control.
+Developers can use the `labelPlacement` property to control how the label is placed relative to the control. This property mirrors the flexbox `flex-direction` property.
import LabelPlacement from '@site/static/usage/v7/radio/label-placement/index.md';
+## Alignment
+
+Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property.
+
+:::note
+Stacked radios can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally.
+:::
+
+import Alignment from '@site/static/usage/v7/radio/alignment/index.md';
+
+
+
## Justification
-Developers can use the `justify` property to control how the label and control are packed on a line.
+Developers can use the `justify` property to control how the label and control are packed on a line. This property mirrors the flexbox `justify-content` property.
import Justify from '@site/static/usage/v7/radio/justify/index.md';
-
:::note
`ion-item` is only used in the demos to emphasize how `justify` works. It is not needed in order for `justify` to function correctly.
:::
diff --git a/docs/api/toggle.md b/docs/api/toggle.md
index 336821e90be..0af93c616ea 100644
--- a/docs/api/toggle.md
+++ b/docs/api/toggle.md
@@ -53,6 +53,17 @@ import LabelPlacement from '@site/static/usage/v7/toggle/label-placement/index.m
+## Alignment
+
+Developers can use the `alignment` property to control how the label and control are aligned on the cross axis. This property mirrors the flexbox `align-items` property.
+
+:::note
+Stacked toggles can be aligned using the `alignment` property. This can be useful when the label and control need to be centered horizontally.
+:::
+
+import Alignment from '@site/static/usage/v7/toggle/alignment/index.md';
+
+
## Justification
@@ -62,7 +73,6 @@ import Justify from '@site/static/usage/v7/toggle/justify/index.md';
-
## Theming
### Colors
diff --git a/static/usage/v7/checkbox/alignment/angular.md b/static/usage/v7/checkbox/alignment/angular.md
new file mode 100644
index 00000000000..4cb28d1b19b
--- /dev/null
+++ b/static/usage/v7/checkbox/alignment/angular.md
@@ -0,0 +1,11 @@
+```html
+
+
+ Aligned to the Start
+
+
+
+ Aligned to the Center
+
+
+```
diff --git a/static/usage/v7/checkbox/alignment/demo.html b/static/usage/v7/checkbox/alignment/demo.html
new file mode 100644
index 00000000000..8cd4888c61b
--- /dev/null
+++ b/static/usage/v7/checkbox/alignment/demo.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+ Checkbox
+
+
+
+
+
+
+
+
+
+
+
+ Aligned to the Start
+
+
+
+ Aligned to the Center
+
+
+
+
+
+
+
diff --git a/static/usage/v7/checkbox/alignment/index.md b/static/usage/v7/checkbox/alignment/index.md
new file mode 100644
index 00000000000..80aa3a8c538
--- /dev/null
+++ b/static/usage/v7/checkbox/alignment/index.md
@@ -0,0 +1,17 @@
+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';
+
+
diff --git a/static/usage/v7/checkbox/alignment/javascript.md b/static/usage/v7/checkbox/alignment/javascript.md
new file mode 100644
index 00000000000..4cb28d1b19b
--- /dev/null
+++ b/static/usage/v7/checkbox/alignment/javascript.md
@@ -0,0 +1,11 @@
+```html
+
+
+ Aligned to the Start
+
+
+
+ Aligned to the Center
+
+
+```
diff --git a/static/usage/v7/checkbox/alignment/react.md b/static/usage/v7/checkbox/alignment/react.md
new file mode 100644
index 00000000000..16b9d9b18e2
--- /dev/null
+++ b/static/usage/v7/checkbox/alignment/react.md
@@ -0,0 +1,25 @@
+```tsx
+import React from 'react';
+import { IonCheckbox, IonItem, IonList } from '@ionic/react';
+
+function Example() {
+ return (
+ <>
+
+
+
+ Aligned to the Start
+
+
+
+
+
+ Aligned to the Center
+
+
+
+ >
+ );
+}
+export default Example;
+```
diff --git a/static/usage/v7/checkbox/alignment/vue.md b/static/usage/v7/checkbox/alignment/vue.md
new file mode 100644
index 00000000000..4dffcd383aa
--- /dev/null
+++ b/static/usage/v7/checkbox/alignment/vue.md
@@ -0,0 +1,24 @@
+```html
+
+
+
+ Aligned to the Start
+
+
+
+ Aligned to the Center
+
+
+
+
+
+```
diff --git a/static/usage/v7/checkbox/label-placement/angular.md b/static/usage/v7/checkbox/label-placement/angular.md
index f2cb87d8171..154f82929d8 100644
--- a/static/usage/v7/checkbox/label-placement/angular.md
+++ b/static/usage/v7/checkbox/label-placement/angular.md
@@ -8,4 +8,8 @@
Fixed Width Label
+
+
+
+Stacked Label
```
diff --git a/static/usage/v7/checkbox/label-placement/demo.html b/static/usage/v7/checkbox/label-placement/demo.html
index 68f4256f4c1..b010f8e8a3e 100644
--- a/static/usage/v7/checkbox/label-placement/demo.html
+++ b/static/usage/v7/checkbox/label-placement/demo.html
@@ -24,6 +24,10 @@
Fixed Width Label
+
+
+
+ Stacked Label
diff --git a/static/usage/v7/checkbox/label-placement/javascript.md b/static/usage/v7/checkbox/label-placement/javascript.md
index e3321ed4f9b..be18191d9a0 100644
--- a/static/usage/v7/checkbox/label-placement/javascript.md
+++ b/static/usage/v7/checkbox/label-placement/javascript.md
@@ -8,4 +8,8 @@
Fixed Width Label
+
+
+
+Stacked Label
```
diff --git a/static/usage/v7/checkbox/label-placement/react.md b/static/usage/v7/checkbox/label-placement/react.md
index 7c9bf728131..6fc222b9035 100644
--- a/static/usage/v7/checkbox/label-placement/react.md
+++ b/static/usage/v7/checkbox/label-placement/react.md
@@ -14,6 +14,10 @@ function Example() {
Fixed Width Label
+
+
+
+ Stacked Label
>
);
}
diff --git a/static/usage/v7/checkbox/label-placement/vue.md b/static/usage/v7/checkbox/label-placement/vue.md
index 942149628cd..3530731da53 100644
--- a/static/usage/v7/checkbox/label-placement/vue.md
+++ b/static/usage/v7/checkbox/label-placement/vue.md
@@ -9,6 +9,10 @@
Fixed Width Label
+
+
+
+ Stacked Label
+
+
+
+
+
+
+
+
+
+