A primary button allow users to take actions, and make choices, with a single tap.
Buttons are aligned to the right hand side of a page. In some cases where there are form fields that need an approximate action, the button can be placed at the right end of a row if there are 1-3 form fields before.
Describe the action that will occur if a user taps a button. For maximum legibility, don’t wrap text.
Buttons take the size of their container, spanning a minimum of 3 columns in the foundation grid.
A layout should contain a single prominent button that makes it clear that other buttons have less importance in the hierarchy. Emphasis is conveyed with styling:
Use a <button>
tag with the appropriate class and a clear text label. Additional hidden text can be added to the label if context requires so.
Normal State
let button : AAButton = AAButton(frame: CGRect.zero)
button.type = .secondary
button.theme = Aileron.theme
button.setTitle("Tap me", forState: .normal)
self.view.addSubview(button)
Disabled State
let disablebutton : AAButton = AAButton(frame: CGRect.zero)
disablebutton.type = .secondary
disablebutton.isEnabled = false
disablebutton.theme = Aileron.theme //Default theme: Aileron
disablebutton.setTitle("Tap me", forState: .normal)
self.view.addSubview(disablebutton)
<img src="../../app-component-images/ios/ios-primary-button-spec.svg" alt="iOS: Primary Button Spec" />