ArtificialSenseDocs

Docs / Components

SenseInplaceComponent

Inline display/edit toggle from @artificialsenselabs/ui with keyboard support, focus restore, and forms CVA. Not surface chrome — style the host or projected slots as needed.

Live demo: run nx serve showcase and open /components/inplace (port 4202).

Overview

Category: Display. Selector: sense-inplace. Import: import { SenseInplaceComponent } from '@artificialsenselabs/ui';

<sense-inplace
  [(ngModel)]="title"
  (activated)="onEditStart()"
  (deactivated)="onEditEnd()"
/>

Project custom display or editor markup via [senseInplaceDisplay] and [senseInplaceContent]. When displayLabel is set, the built-in value span is hidden — project display content yourself.

Inputs & outputs

MemberTypeDefaultDescription
activebooleanfalseTwo-way model — edit region shown when true.
valuestring''Current text value; two-way bindable via CVA.
closablebooleanfalseShows explicit close control in edit mode (blur still closes).
displayLabelstring | nullnullAccessible name override; when set, hides the built-in value span (project display).
activatedvoidEmitted when entering edit mode.
deactivatedvoidEmitted when returning to display mode.

Accessibility

  • Disclosure-style swap: the activator has aria-expanded / aria-controls while closed; while editing the activator is removed and the edit region is shown (APG disclosure interaction, not a persistent button).
  • Focus: activate moves focus into the input after the next render; deactivate (blur / Escape / close) restores focus to the activator after it remounts.
  • Enter/Space activates; Escape returns to display.
  • Implements ControlValueAccessor for Angular forms.