Component docs
Loading
import { EditableText } from "@pixxl-tools/components";
// In Server Components:
import { EditableText } from "@pixxl-tools/components/server";| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Current value (controlled); null where it means "nothing selected". |
cancelLabel | string | — | — |
defaultOpen | boolean | — | Initial open state when uncontrolled. |
defaultValue | string | — | Initial value when uncontrolled. |
editLabel | string | — | — |
inputLabel | string | — | — |
onCancel | () => void | — | — |
onOpenChange | (open: boolean) => void | — | Called with the next open state. |
onSubmit | (value: string) => void | — | Called with the edited text when it is saved (Enter or Save). |
onValueChange | (value: string) => void | — | Called with the new value (only when it changes). |
open | boolean | — | Open state (controlled). |
saveLabel | string | — | — |
valuestring
Current value (controlled); null where it means "nothing selected".
cancelLabelstring
defaultOpenboolean
Initial open state when uncontrolled.
defaultValuestring
Initial value when uncontrolled.
editLabelstring
inputLabelstring
onCancel() => void
onOpenChange(open: boolean) => void
Called with the next open state.
onSubmit(value: string) => void
Called with the edited text when it is saved (Enter or Save).
onValueChange(value: string) => void
Called with the new value (only when it changes).
openboolean
Open state (controlled).
saveLabelstring
<EditableText value="Canvas" />