Activity Forums Salesforce® Discussions What is difference between Lightning button () and ui button()

  • Raghav Chaturvedi

    Member
    July 12, 2017 at 8:31 am

    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.

  • Parul

    Member
    September 19, 2018 at 6:28 pm

    Hi

    Lightning button

    A lightning:button component represents a button element that executes an action in a controller. Clicking the button triggers the client-side controller method set for on click. Buttons can be either a label only, label and icon, body only, or body and icon. Use lightning:button Icon if you need an icon-only button.

    UI button

    A ui:button component represents a button element that executes an action defined by a controller. Clicking the button triggers the client-side controller method set for the press event

  • shariq

    Member
    September 19, 2018 at 10:59 pm

    Hi,

    Note - <ui:button> is going to be deprecated by salesforce soon, so change ui tag to lightning one.

    Hope this helps.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos