File size: 1,434 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---
title: Editable
description: Used for inline renaming of some text.
links:
  source: components/editable
  storybook: components-editable--basic
  recipe: editable
  ark: https://ark-ui.com/react/docs/components/editable
---

<ExampleTabs name="editable-basic" />

## Usage

```jsx
import { Editable } from "@chakra-ui/react"
```

```jsx
<Editable.Root>
  <Editable.Preview />
  <Editable.Input />
</Editable.Root>
```

## Examples

### Double Click

Use the `activationMode` prop to make the content editable when users double
click.

<ExampleTabs name="editable-with-double-click" />

### Disabled

Use the `disabled` prop to disable the editable component.

<ExampleTabs name="editable-disabled" />

### Textarea

You can make a text area editable.

<ExampleTabs name="editable-with-textarea" />

### With Controls

Add controls such as "edit", "cancel" and "submit" to `Editable` for better user
experience.

<ExampleTabs name="editable-with-controls" />

### Controlled

Use the `value` and `onValueChange` props to control the editable component.

<ExampleTabs name="editable-controlled" />

### Store

An alternative way to control the editable component is to use the
`RootProvider` component and the `useEditable` store hook.

This way you can access the editable state and methods from outside the
editable.

<ExampleTabs name="editable-with-store" />

## Props

### Root

<PropTable component="Editable" part="Root" />