Examples
Documentation
Accessibility
Attribute | Applied to | Outcome |
---|---|---|
aria-label="Plus" , aria-label="Minus" | .pf-v5-c-button.pf-m-control | Provides an accessible name for the outer plus/minus buttons. Required |
min | input[type="number"].pf-v5-c-form-control | Provides an optional minimum value for the input. |
max | input[type="number"].pf-v5-c-form-control | Provides an optional maximum value for the input. |
Usage
Class | Applied to | Outcome |
---|---|---|
.pf-v5-c-number-input | <div> | Initiates the number input component. |
.pf-v5-c-number-input__icon | <span> | Initiates the number input icon. |
.pf-v5-c-number-input__unit | <span> | Initiates the number input unit. |
.pf-m-status | .pf-v5-c-number-input | Modifies the width to create enough space for a status icon to be included in the form control portion of the number input. Required if a status icon may be shown, even if the icon is not currently shown. |
--pf-v5-c-number-input--c-form-control--width-chars | .pf-v5-c-number-input | Specifies the number of characters to show in the input. |
CSS variables
Expand or collapse column | Selector | Variable | Value | |
---|---|---|---|---|
.pf-v5-c-number-input | --pf-v5-c-number-input__unit--c-input-group--MarginLeft | 0.5rem | ||
--pf-v5-c-number-input__unit--c-input-group--MarginLeft --pf-v5-global--spacer--sm $pf-v5-global--spacer--sm pf-size-prem(8px) 0.5rem | ||||
.pf-v5-c-number-input | --pf-v5-c-number-input__icon--FontSize | 0.75rem | ||
--pf-v5-c-number-input__icon--FontSize --pf-v5-global--FontSize--xs $pf-v5-global--FontSize--xs pf-font-prem(12px) 0.75rem | ||||
.pf-v5-c-number-input | --pf-v5-c-number-input--c-form-control--width-base | calc(0.5rem * 2 + 1px * 2) | ||
--pf-v5-c-number-input--c-form-control--width-base calc(--pf-v5-global--spacer--sm * 2 + --pf-v5-global--BorderWidth--sm * 2) calc($pf-v5-global--spacer--sm * 2 + $pf-v5-global--BorderWidth--sm * 2) calc(pf-size-prem(8px) * 2 + 1px * 2) calc(0.5rem * 2 + 1px * 2) | ||||
.pf-v5-c-number-input | --pf-v5-c-number-input--c-form-control--width-icon | 0px | ||
.pf-v5-c-number-input | --pf-v5-c-number-input--m-status--c-form-control--width-icon | 2rem | ||
--pf-v5-c-number-input--m-status--c-form-control--width-icon --pf-v5-global--spacer--xl $pf-v5-global--spacer--xl pf-size-prem(32px) 2rem | ||||
.pf-v5-c-number-input | --pf-v5-c-number-input--c-form-control--width-chars | 4 | ||
.pf-v5-c-number-input | --pf-v5-c-number-input--c-form-control--Width | calc(
calc(
calc(0.5rem * 2 + 1px * 2) + 4 * 1ch
) + 0px
) | ||
--pf-v5-c-number-input--c-form-control--Width calc(
calc(
--pf-v5-c-number-input--c-form-control--width-base + --pf-v5-c-number-input--c-form-control--width-chars * 1ch
) + --pf-v5-c-number-input--c-form-control--width-icon
) calc(
calc(
calc(--pf-v5-global--spacer--sm * 2 + --pf-v5-global--BorderWidth--sm * 2) + 4 * 1ch
) + 0px
) calc(
calc(
calc($pf-v5-global--spacer--sm * 2 + $pf-v5-global--BorderWidth--sm * 2) + 4 * 1ch
) + 0px
) calc(
calc(
calc(pf-size-prem(8px) * 2 + 1px * 2) + 4 * 1ch
) + 0px
) calc(
calc(
calc(0.5rem * 2 + 1px * 2) + 4 * 1ch
) + 0px
) | ||||
.pf-v5-c-number-input.pf-m-status | --pf-v5-c-number-input--c-form-control--width-icon | 2rem | ||
--pf-v5-c-number-input--c-form-control--width-icon --pf-v5-c-number-input--m-status--c-form-control--width-icon --pf-v5-global--spacer--xl $pf-v5-global--spacer--xl pf-size-prem(32px) 2rem |
View source on GitHub