Next Chapter Begins 🚀Read the full story

Inplace

Inplace provides an easy to do editing and display at the same time where clicking the output displays the actual content.

Profile

Update your profile settings.

Name
Password
preview

Installation#

npx shadcn@latest add https://primereact.dev/r/inplace.json

Usage#

import { Inplace, InplaceClose, InplaceContent, InplaceDisplay } from '@/components/ui/inplace';
<Inplace>
    <InplaceDisplay>Click to Edit</InplaceDisplay>
    <InplaceContent>
        <InputText />
    </InplaceContent>
</Inplace>

Examples#

Basic#

Switches between a display and an edit mode on click.

Name
basic-demo

Disabled#

Use the disabled prop to disable the inplace content.

Profile

Update your profile settings.

Name
Email
Password
disabled-demo

Controlled#

Use the open and onOpenChange props to control the inplace content.

Name
controlled-demo

Image#

Any content such as an image can be placed inside the InplaceContent component.

image-demo

Sub-Components#

See Primitive API for sub-component documentation.

Hooks#

See Headless API for hook documentation.

Accessibility#

See Inplace Primitive for WAI-ARIA compliance details and keyboard support.