Props
Usage guidelines
See Button.
Variants
rel and target
These optional props control the behavior of ButtonLink. External links commonly use target="_blank"
to open the link in a new tab or window, and rel="nofollow"
to provide hints for SEO.
import { ButtonLink, Flex } from 'gestalt'; export default function Example() { return ( <Flex alignItems="center" height="100%" justifyContent="center" width="100%" > <ButtonLink accessibilityLabel="Visit Pinterest" iconEnd="visit" size="lg" text="Visit Pinterest" rel="nofollow" target="blank" href="#" /> </Flex> ); }
Accessibility
Variants
External handlers
ButtonLink consumes external handlers from GlobalEventsHandlerProvider.
Handlers:
- onNavigation: executed when ButtonLink is clicked
See GlobalEventsHandlerProvider for more information.
Component quality checklist
Quality item | Status | Status description |
---|---|---|
Figma Library | Component is not currently available in Figma. | |
Responsive Web | Ready | Component responds to changing viewport sizes in web and mobile web. |
Related
Button
Use Button when an action is needed instead of a link.
ButtonGroup
When displaying multiple Buttons in a layout, use ButtonGroup to ensure consistent spacing and wrapping behavior.
IconButton
Use IconButton when only an icon is needed instead of text.
TapArea
Use TapArea to make non-button elements interactive, like an Image. This ensures the element interaction is accessible and uses Gestalt styles.
Tabs
Tabs are intended for page-level navigation between multiple URLs.
GlobalEventsHandlerProvider
GlobalEventsHandlerProvider allows external link navigation control across all children components with link behavior.
See GlobalEventsHandlerProvider to learn more about link navigation.