Primary
{{ include( 'components/button.twig', { slot: "View Programs" href: "/programs/" variant: "filled" } ) }}
Default buttons are styled to work on light backgrounds while maintaining a high enough contrast ratio, while the inverse buttons are used when a button needs to be placed over a dark background.
There are three main button variants:
Variant | Prominence | Description | Main Usage |
---|---|---|---|
default/Tertiary | Low | No border or fill, simply text with spacing around it to match other button variations | Other minor text-based CTAs |
Outlined/Secondary | Medium | Border is set around the button, but it has no fill color | Most button-derived CTAs |
Filled/Primary | High | Fill color and an alternate text color | Used to launch RFI |
This component can be added to post content with the Button block in the Gutenberg editor.
Property | Type | Description | Required | Default |
---|---|---|---|---|
label | string | Button text | Yes | - |
is_link | boolean | Set to true to use an `a` tag | No | - |
url | string | - | No | - |
style | string | 'secondary' or 'tertiary'. False by default, making button primary | No | false |
style_inverse | boolean | Deprecated, use button color utility classes when possible instead | No | - |
dialog | string | Name of dialog to open on the page | No | - |
id | string | - | No | - |
class | string | list of additional classes to apply to main element. | No | - |
Name | Class | Description |
---|---|---|
Secondary | .tux-c-button--secondary | Outline-style button for medium prominence |
Tertiary | .tux-c-button--tertiary | transparent button for low prominence |
Narrow | .tux-c-button--narrow | decreases padding around label text for when space is limited |
Name | Default | Resets | Description |
---|---|---|---|
--tux-c-button--bg | #222 | Yes | Used as the main button color. For secondary/tertiary buttons, it will be applied to the text and border. |
--tux-c-button--text | #fff | Yes | Only used for primary buttons to provide a color with contrast to the main background color |
--tux-c-button--bg-hover | #151515 | Yes | - |
--tux-c-button--bg-active | #090909 | Yes | - |
--tux-c-button--bg-t-hover | rgba(34, 34, 34, 0.1) | Yes | Used for secondary and tertiary |
--tux-c-button--bg-t-active | rgba(34, 34, 34, 0.2) | Yes | Used for secondary and tertiary |
Other components that use this component (not including freeform content slots).
{{ include( 'components/button.twig', { slot: "View Programs" href: "/programs/" variant: "filled" } ) }}
{{ include( 'components/button.twig', { slot: "View Programs" href: "/programs/" variant: "outlined" } ) }}
{{ include( 'components/button.twig', { label: "View Scholarships" is_link: true url: "/external-url/" target: "_blank" style: "tertiary" } ) }}
{{ include( 'components/button.twig', { label: "View Programs" is_link: true url: "/programs/" style_inverse: true } ) }}
{{ include( 'components/button.twig', { label: "View Programs" is_link: true url: "/programs/" style: "secondary" style_inverse: true } ) }}
{{ include( 'components/button.twig', { label: "View Scholarships" is_link: true url: "/external-url/" target: "_blank" style: "tertiary" style_inverse: true } ) }}
<ul class="tux-c-action-list u-p2"> <li> <x-button href="#" variant="filled">{{ fa_icon('solid/lamp-desk') }} Icon Label</x-button> </li> <li> <x-button href="#" variant="filled">Button Label</x-button> </li> <li> <x-button href="#" variant="outlined">{{ fa_icon('solid/gift') }} Icon Label</x-button> </li> <li> <x-button href="#" variant="outlined">Button Label</x-button> </li> <li> <x-button href="#">Button Label</x-button> </li> <li> <x-button href="#">Icon Label {{ fa_icon('solid/arrow-right') }}</x-button> </li> </ul> <ul class="tux-c-action-list u-bg--black u-p2"> <li> <x-button href="#" variant="filled">{{ fa_icon('solid/book') }} Icon Label</x-button> </li> <li> <x-button href="#" variant="filled">Button Label</x-button> </li> <li> <x-button href="#" variant="outlined">{{ fa_icon('solid/comment-alt-smile') }} Icon Label</x-button> </li> <li> <x-button href="#" variant="outlined">Button Label</x-button> </li> <li> <x-button href="#">Button Label</x-button> </li> <li> <x-button href="#">Icon Label {{ fa_icon('solid/arrow-right') }}</x-button> </li> </ul>