Salesforce Decode
Salesforcedecode
Back to questions
LWCBeginnerbase-componentshtml

Compare LWC base components vs custom HTML elements

Real World Scenario

Developers build custom checkbox inputs inconsistent with Lightning Experience styling.

Expected Answer

• lightning-input lightning-combobox platform consistency • Base components handle a11y FLS variants automatically • Custom HTML only when base lacks feature documented gap • SLDS manual application error-prone on custom HTML • Future platform updates benefit base components free • Custom inputs require full keyboard and aria implementation

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Direct answer: lightning-input lightning-combobox platform consistency Also consider: Base components handle a11y FLS variants automatically In practice: Custom HTML only when base lacks feature documented gap Keep the solution simple and well-documented for the team.

Architect Perspective

Default to base components—custom HTML is last resort with a11y tax.