Introducing PrimeReact v11-alpha 🎉Discover Now

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
John Doe
Password
********
preview

Installation#

npx shadcn@latest add @primereact/inplace

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.

Profile

Update your profile settings.

Name
John Doe
Password
********
basic-demo

Disabled#

Use the disabled prop to disable the inplace content.

Profile

Update your profile settings.

Name
John Doe
Email
Password
********
disabled-demo

Controlled#

Use the active and onActiveChange props to control the inplace content.

Name
John Doe
controlled-demo

Image#

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

View Photo
image-demo

API#

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.