Buttons
Buttons are built from shared token values and semantic variants. They contain styles for the following states hover, active, focus, and disabled. The default button is the primary variant, and secondary and danger variants are also available. Size modifiers are also available for extra-small through extra-large buttons.
Default Button
Size Modifiers
Medium is the default size and does not require a modifier class.
Size modifiers:
corn-button--xscorn-button--smcorn-button--mdcorn-button--lgcorn-button--xl
Extra Small
Small
Medium (Default)
This modifier is not necessary for medium buttons, but it can be used for consistency in code when the button size is being dynamically set.
Large
Extra Large
Icon Buttons
Icon buttons are used for actions that can be represented by an icon without text. They use the same classes as regular buttons, but also include an icon element. The aria-label attribute should be used to provide a label for screen readers.
Add corn-button--icon to the button class list to apply the icon button styles.
Icon Only (xs)
Icon Only (sm)
Icon Only (md)
Icon Only (lg)
Icon Only (xl)
Button Tokens
Button styles are built from shared tokens and semantic variants.
Below are the tokens used in the button component, which can be found in the button-tokens.css file.