diff --git a/core/api.txt b/core/api.txt
index f3fdbbd60a..26be0122bd 100644
--- a/core/api.txt
+++ b/core/api.txt
@@ -623,6 +623,7 @@ ion-input,prop,placeholder,string | undefined,undefined,false,false
ion-input,prop,readonly,boolean,false,false,true
ion-input,prop,required,boolean,false,false,false
ion-input,prop,shape,"round" | undefined,undefined,false,false
+ion-input,prop,size,"large" | undefined,undefined,false,false
ion-input,prop,spellcheck,boolean,false,false,false
ion-input,prop,step,string | undefined,undefined,false,false
ion-input,prop,theme,"ios" | "md" | "ionic",undefined,false,false
diff --git a/core/src/components.d.ts b/core/src/components.d.ts
index eec75790d3..9cd8c797de 100644
--- a/core/src/components.d.ts
+++ b/core/src/components.d.ts
@@ -1450,6 +1450,10 @@ export namespace Components {
* The shape of the input. If "round" it will have an increased border radius.
*/
"shape"?: 'round';
+ /**
+ * The size of the input. If "large", it will have an increased height. By default the size is unset. This property only applies to the `"ionic"` theme.
+ */
+ "size"?: 'large';
/**
* If `true`, the element will have its spelling and grammar checked.
*/
@@ -6694,6 +6698,10 @@ declare namespace LocalJSX {
* The shape of the input. If "round" it will have an increased border radius.
*/
"shape"?: 'round';
+ /**
+ * The size of the input. If "large", it will have an increased height. By default the size is unset. This property only applies to the `"ionic"` theme.
+ */
+ "size"?: 'large';
/**
* If `true`, the element will have its spelling and grammar checked.
*/
diff --git a/core/src/components/input/input.ionic.scss b/core/src/components/input/input.ionic.scss
index 3d1a752d80..863679e7c7 100644
--- a/core/src/components/input/input.ionic.scss
+++ b/core/src/components/input/input.ionic.scss
@@ -3,3 +3,12 @@
// Ionic Input
// --------------------------------------------------
+
+
+
+// Ionic Input Sizes
+// --------------------------------------------------
+
+:host(.input-size-large) {
+ min-height: 48px;
+}
diff --git a/core/src/components/input/input.tsx b/core/src/components/input/input.tsx
index 227324f11b..9208f170f0 100644
--- a/core/src/components/input/input.tsx
+++ b/core/src/components/input/input.tsx
@@ -4,6 +4,7 @@ import type { NotchController } from '@utils/forms';
import { createNotchController } from '@utils/forms';
import type { Attributes } from '@utils/helpers';
import { inheritAriaAttributes, debounceEvent, inheritAttributes, componentOnReady } from '@utils/helpers';
+import { printIonWarning } from '@utils/logging';
import { createSlotMutationController } from '@utils/slot-mutation-controller';
import type { SlotMutationController } from '@utils/slot-mutation-controller';
import { createColorClasses, hostContext } from '@utils/theme';
@@ -251,6 +252,12 @@ export class Input implements ComponentInterface {
*/
@Prop() step?: string;
+ /**
+ * The size of the input. If "large", it will have an increased height. By default the
+ * size is unset. This property only applies to the `"ionic"` theme.
+ */
+ @Prop() size?: 'large';
+
/**
* The type of control to display. The default type is text.
*/
@@ -464,6 +471,16 @@ export class Input implements ComponentInterface {
return typeof this.value === 'number' ? this.value.toString() : (this.value || '').toString();
}
+ private getSize() {
+ const theme = getIonTheme(this);
+ const { size } = this;
+ if (theme !== 'ionic' && size === 'large') {
+ printIonWarning(`The "${size}" size is not supported in the ${theme} theme.`);
+ return undefined;
+ }
+ return size;
+ }
+
private onInput = (ev: InputEvent | Event) => {
const input = ev.target as HTMLInputElement | null;
if (input) {
@@ -686,6 +703,7 @@ export class Input implements ComponentInterface {
const { disabled, fill, readonly, shape, inputId, labelPlacement, el, hasFocus } = this;
const theme = getIonTheme(this);
const value = this.getValue();
+ const size = this.getSize();
const inItem = hostContext('ion-item', this.el);
const shouldRenderHighlight = theme === 'md' && fill !== 'outline' && !inItem;
@@ -721,6 +739,7 @@ export class Input implements ComponentInterface {
'label-floating': labelShouldFloat,
[`input-fill-${fill}`]: fill !== undefined,
[`input-shape-${shape}`]: shape !== undefined,
+ [`input-size-${size}`]: size !== undefined,
[`input-label-placement-${labelPlacement}`]: true,
'in-item': inItem,
'in-item-color': hostContext('ion-item.ion-color', this.el),
diff --git a/core/src/components/input/test/size/index.html b/core/src/components/input/test/size/index.html
new file mode 100644
index 0000000000..06605abfa9
--- /dev/null
+++ b/core/src/components/input/test/size/index.html
@@ -0,0 +1,74 @@
+
+
+