UtilityButton acts as inline page navigation and should always be used in groups of two or more, compared to the Button component which is designed to work as a standalone element and performs the role of a call-to-action (CTA).
npm install @nib/utility-button
import UtilityButton from '@nib/utility-button';
|string||The main text string of the button.|
|string||The subtitle text string of the button.|
|component||An icon to be displayed on the left of the button. Must be an icon from the @nib/icons package.|
|boolean||Option to display a border.|
|boolean||Option to display the chevron.|
|boolean||Option to truncate the title and subtitle. Given this component is a CTA truncating the label is not recommended.|
|string||Add a link to the button. Note that the component is rendered as an |
|function||If the component is required to carried out some complex functionality other than linking|
|string or component||What to render the utility button as. Should be either a |
Components must be wrapped by this Theme
Props used on one UtilityButton should be carried through to all other UtilityButtons within the group. So for example, if an icon is included in one UtilityButton, then all UtilityButtons should include an icon. All UtilityButtons used in a group should be uniform.
Be conscious of the number of UtilityButton components you have in a group and the impact that has on available space for the title/subtitle. Within our Container component we've found that 4 - 5 is the most that can comfortably fit. If using icons, this drops down to 3 - 4. If including close to the maximum number of utility buttons be sure to set
collapseBelow on the
Columns component to
A UtilityButton should be used on either a
lightest background. When the UtilityButton is placed on a
white background, then border should be shown.
flexprop is how we achieve equal heights for the utility buttons when the content lengths differ.