[SalesForce] Difference between lightning:button & ui:button

I was going through the SLDS document and couldn't understand the difference between various UI components provided by SLDS vs Lightning components. For instance,

<ui:button> & <lightning:button> 

They both do the same thing and rendered as a button on the component

Best Answer

If you go thru the Lightning base components release notes, you will notice that the Base components are more of an extended implementation of the existing UI components.

here's an extract of the related section

You can find base Lightning components in the lightning namespace to complement the existing ui namespace components. In instances where there are matching ui and lightning namespace components, we recommend that you use the lightning namespace component. The lightning namespace components are optimized for common use cases. Beyond being equipped with the Lightning Design System styling, they handle accessibility, real-time interaction, and enhanced error messages.

Over a period, the base components will have more features built into it which can be easily configured / controlled by additional attributes.

Related Topic