Introduction
Inline edit is a utilitarian component that has two core elements, .pf-v5-c-inline-edit__value
and .pf-v5-c-inline-edit__input
and is based on a simple concept. When value is visible, input is hidden, and vice versa.
Generic groups
.pf-v5-c-inline-edit__group
s provide basic layout support and have several available modifiers (.pf-m-action-group
, .pf-m-icon-group
).
Actions
Actions (.pf-v5-c-inline-edit__action
) are hidden by default and exposed when a region of .pf-v5-c-inline-edit
becomes active. The default visibility of an action or action group can be inversed by adding .pf-m-enable-editable
. .pf-m-enable-editable
flags an element or group of elements as the controlling agents for enabling editable content and therefore is visible by default and hidden when inline editing is enabled.
Examples
Inline edit toggle can be placed anywhere within .pf-v5-c-inline-edit
. It initiates the editability of elements. When an element becomes editable, toggle is hidden.
Inline edit value can be placed anywhere within .pf-v5-c-inline-edit
. It is visible by default and hidden when inline edit becomes editable.
Inline edit action-group contains save and cancel actions and is only visible when inline edit is editable.
Documentation
Accessibility
All accessibility requirements for inputs apply to elements within inline edit.
Attribute | Applied to | Outcome |
---|---|---|
id | [labelling element] | Provides a reference for toggle button and/or editable content. |
aria-label="descriptive text" | .pf-v5-c-inline-edit__toggle > button | Provides an accessible description for toggle button. Required |
aria-labelledby="[labelling element] [toggle button id]" | .pf-v5-c-inline-edit__toggle > button | Provides an accessible description for toggle button. Required |
aria-label="descriptive text" | [radio button group] | Provides an accessible description for radio groups. Required |
contenteditable="true" | .pf-v5-c-inline-edit__editable-text | Ensures the text node is editable. |
role="textbox" | .pf-v5-c-inline-edit__editable-text | Identifies an element that allows the input of free-form text. |
role="radiogroup" | [radio button group] | Provides an accessible role for radio buttons groups. Required |
Usage
Class | Applied to | Outcome |
---|---|---|
.pf-v5-c-inline-edit | <form> , <div> | Initiates the inline edit component. Required |
.pf-v5-c-inline-edit__value | * | Initiates an inline edit value. Required |
.pf-v5-c-inline-edit__input | * | Initiates an inline edit input. Required |
.pf-v5-c-inline-edit__editable-text | * | Initiates an inline editable text element. |
.pf-v5-c-inline-edit__label | * | Initiates an inline edit label. |
.pf-v5-c-inline-edit__action | * | Initiates an inline edit action (visible when inline edit region is active). Required |
.pf-m-inline-editable | .pf-v5-c-inline-edit , .pf-v5-c-inline-edit [block level element] | Modifies an inline edit region for editable state. |
.pf-m-action-group | .pf-v5-c-inline-edit__group | Modifies group for action group. |
.pf-m-icon-group | .pf-v5-c-inline-edit__group | Modifies an action group item spacing. |
.pf-m-column | .pf-v5-c-inline-edit__group | Modifies an action group flex direction. |
.pf-m-footer | .pf-v5-c-inline-edit__group | Modifies an inline edit group margin-top. |
.pf-m-bold | .pf-v5-c-inline-edit__label | Modifies an inline edit label's font-weight . |
.pf-m-valid | .pf-v5-c-inline-edit__action | Modifies the action button state. |
.pf-m-enable-editable | .pf-v5-c-inline-edit__action | Exposes an inline edit action by default. |
-->
CSS variables
Expand or collapse column | Selector | Variable | Value | |
---|---|---|---|---|
.pf-v5-c-inline-edit | --pf-v5-c-inline-edit__group--item--MarginRight | 0.5rem | ||
--pf-v5-c-inline-edit__group--item--MarginRight --pf-v5-global--spacer--sm $pf-v5-global--spacer--sm pf-size-prem(8px) 0.5rem | ||||
.pf-v5-c-inline-edit | --pf-v5-c-inline-edit__action--c-button--m-valid--m-plain--Color | #06c | ||
--pf-v5-c-inline-edit__action--c-button--m-valid--m-plain--Color --pf-v5-global--link--Color $pf-v5-global--link--Color $pf-v5-global--primary-color--100 $pf-v5-color-blue-400 #06c | ||||
.pf-v5-c-inline-edit | --pf-v5-c-inline-edit__action--c-button--m-valid--m-plain--hover--Color | #004080 | ||
--pf-v5-c-inline-edit__action--c-button--m-valid--m-plain--hover--Color --pf-v5-global--link--Color--hover $pf-v5-global--link--Color--hover $pf-v5-global--primary-color--200 $pf-v5-color-blue-500 #004080 | ||||
.pf-v5-c-inline-edit | --pf-v5-c-inline-edit__action--m-icon-group--item--MarginRight | 0 | ||
.pf-v5-c-inline-edit | --pf-v5-c-inline-edit__group--m-footer--MarginTop | 2rem | ||
--pf-v5-c-inline-edit__group--m-footer--MarginTop --pf-v5-global--spacer--xl $pf-v5-global--spacer--xl pf-size-prem(32px) 2rem | ||||
.pf-v5-c-inline-edit | --pf-v5-c-inline-edit__label--m-bold--FontWeight | 700 | ||
--pf-v5-c-inline-edit__label--m-bold--FontWeight --pf-v5-global--FontWeight--bold $pf-v5-global--FontWeight--bold 700 | ||||
.pf-v5-c-inline-edit__group.pf-m-icon-group | --pf-v5-c-inline-edit__group--item--MarginRight | 0 | ||
--pf-v5-c-inline-edit__group--item--MarginRight --pf-v5-c-inline-edit__action--m-icon-group--item--MarginRight 0 | ||||
.pf-v5-c-inline-edit__group.pf-m-column | --pf-v5-c-inline-edit__group--item--MarginRight | 0 | ||
.pf-v5-c-inline-edit__group > :last-child | --pf-v5-c-inline-edit__group--item--MarginRight | 0 | ||
.pf-v5-c-inline-edit__action.pf-m-valid .pf-v5-c-button.pf-m-plain | --pf-v5-c-button--m-plain--Color | #06c | ||
--pf-v5-c-button--m-plain--Color --pf-v5-c-inline-edit__action--c-button--m-valid--m-plain--Color --pf-v5-global--link--Color $pf-v5-global--link--Color $pf-v5-global--primary-color--100 $pf-v5-color-blue-400 #06c | ||||
.pf-v5-c-inline-edit__action.pf-m-valid .pf-v5-c-button.pf-m-plain:hover | --pf-v5-c-button--m-plain--Color | #004080 | ||
--pf-v5-c-button--m-plain--Color --pf-v5-c-inline-edit__action--c-button--m-valid--m-plain--hover--Color --pf-v5-global--link--Color--hover $pf-v5-global--link--Color--hover $pf-v5-global--primary-color--200 $pf-v5-color-blue-500 #004080 |
View source on GitHub