Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Editable

activationMode controls how editing starts. submitMode controls how the value is committed.

import { Editable } from '@manti-ui/react';

export default function EditableBasic() {
  return (
    <Editable
      label="Recipe name"
      variant="primary"
      defaultValue="Kayseri mantısı"
      placeholder="Enter a name…"
      activationMode="focus"
      submitMode="both"
    />
  );
}

API

PropTypeDefaultDescription
labelReactNodeOptional field label.
variantMantiVariant'primary'Focus-ring variant.
valuestringControlled value.
defaultValuestringInitial value for uncontrolled usage.
onValueChange(value: string) => voidCalled whenever the value changes.
onValueCommit(value: string) => voidCalled when the value is committed (Enter/blur/submit).
activationMode'focus' | 'dblclick' | 'click' | 'none'What enters edit mode.
submitMode'enter' | 'blur' | 'both' | 'none'What commits the value.
placeholderstringPlaceholder shown when empty.
disabledbooleanDisable editing.
readOnlybooleanMake the field read-only.
requiredbooleanMark the field as required.
invalidbooleanMark the field as invalid.
namestringForm field name.

Styling

Anatomy

PartSelectorDescription
root[data-scope="editable"][data-part="root"]The field wrapper; carries data-variant.
label[data-scope="editable"][data-part="label"]The field label.
area[data-scope="editable"][data-part="area"]Wraps the preview and the input.
preview[data-scope="editable"][data-part="preview"]The static text shown when not editing.
input[data-scope="editable"][data-part="input"]The text input shown in edit mode.
control[data-scope="editable"][data-part="control"]Wraps the edit/save/cancel buttons.
edit-trigger[data-scope="editable"][data-part="edit-trigger"]Enters edit mode.
submit-trigger[data-scope="editable"][data-part="submit-trigger"]Commits the value.
cancel-trigger[data-scope="editable"][data-part="cancel-trigger"]Discards the edit.

Tokens

TokenControls
--manti-editable-heightheight

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub