# What is the difference between lightning-record-form, lightning-record-edit-form and lightning-record-view-form?

**Topic:** Development · **Difficulty:** Easy · **Tags:** lwc, lds, forms

Read it on the site: https://www.forcechallenges.com/interview-questions/what-is-the-difference-between-lightning-record-form-lightning-record-edit-form-and-lightning-record-view-form

## Answer

All use Lightning Data Service, so no Apex is needed and FLS/sharing are respected.

- **lightning-record-form** – quickest option; auto-generates a full form (view, edit or read-only) from fields or layout. Least customizable.
- **lightning-record-edit-form** – you control the layout with `lightning-input-field` and can add custom buttons, validation and handle `onsubmit`, `onsuccess`, `onerror`.
- **lightning-record-view-form** – read-only display using `lightning-output-field`.

Choose record-form for simple CRUD, edit-form for custom layouts, view-form for read-only pages.

---
Source: ForceChallenges · last updated 2026-10-19
