Overview

Inline Editable was designed to keep input borders to a minimum when not engaged. The "Save" and "Discard" controls can be disabled using the controls property.

Inline Editable must contain an Input in its default slot.

Sample

Usage

  • As a more deliberate interaction to change text than a standard Input
  • Situations where text input is not a primary function
  • A title or header for a section of content
  • Content that can have a text change after being submitted

Best practices

Below are important guidelines on using the Inline Editable component.

Correct Inline Editable headers
Do use in situations where inputs would be distracting.
Avoid Inline Editable headers
Avoid using in forms.

Accessibility

Keyboard navigation

KeyFunction
TabMoves focus in and out of the component.
Tab and ShiftMoves focus in and out of the component.
EnterWhen editingEnabled is false, enables inline editing.
SpaceWhen editingEnabled is false, enables inline editing.

API reference

Properties

PropertyAttributeDescriptionTypeDefault
afterConfirm

Specifies a callback to be executed prior to disabling editing via the controls. When provided, the component's loading state will be handled automatically.

() => Promise<void>
controlscontrols

When true and editingEnabled is true, displays save and cancel controls.

booleanfalse
disableddisabled

When true, prevents interaction and decreases the component's opacity.

booleanfalse
editingEnabledediting-enabled

When true, inline editing is enabled.

booleanfalse
loadingloading

When true, a busy indicator is displayed.

booleanfalse
messageOverrides

Overrides individual strings used by the component.

Record<string, unknown> | undefined
scalescale

Specifies the size of the component.

Scale"m"

Slots

NameDescription
default (unnamed)

A slot for adding a calcite-input.

Styles

NameDescription
--calcite-inline-editable-background-color-hover

Specifies the component's background color when hovered.

--calcite-inline-editable-background-color

Specifies the component's background color.

--calcite-inline-editable-button-background-color

When appearance="solid" or appearance="outline-fill", specifies the background color of the component's button element.

--calcite-inline-editable-button-corner-radius

Specifies the corner radius of the component's button element.

--calcite-inline-editable-button-loader-color

Specifies the loader color of the component's button element.

--calcite-inline-editable-button-text-color

Specifies the text color of the component's button element.

Events

NameDescriptionBehavior
calciteInlineEditableEditCancel

Fires when the component's "cancel editing" button is pressed.

bubblescomposed
calciteInlineEditableEditConfirm

Fires when the component's "confirm edits" button is pressed.

bubblescomposed

Methods

NameDescriptionSignature
componentOnReady

Creates a promise that resolves once the component is fully loaded.

componentOnReady(): Promise<this>
setFocus

Sets focus on the component.

setFocus(options?: FocusOptions): Promise<void>

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.