I'm trying to apply a specific variant to a lightning button. Lightning Design System says there is a button variation called outline-brand. It applies the slds-button_outline-brand class to the button.

However, the component documentation doesn't show that variant option available. I've tried something like this:

<lightning:button variant="outline-brand" label="Cancel" />                

Can this be done as a variant or do I need to use class instead?

  • I guess you are right, we have to use the class as of now. Nov 13 '18 at 17:55

The Lightning Component Library (LCL) tends to lag behind the Salesforce Lightning Design System (SLDS) by about one release on average; two different teams are working on these two parts of Salesforce, so it is strictly true that there must be some lag time between when a style is defined and when it makes it in to the LCL. For now, assuming the style is available (I haven't checked), you should be able to use it as a class in this release, and it will likely become a variant you can use in the next release (note: there's no guarantee of this, but it seems reasonable). The class version, of course, will always work in to the foreseeable future now that SLDS has stabilized its design patterns.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.