Links allow users to navigate to other pages in an application. Links can be presented as standalone text or inline inside a paragraph, or used to enhance other elements, like headings or images, with navigation behavior.
Link should:
Links should not:
Used for either stand-alone navigational actions or links within larger spans of text.
Links accept any ReactElement as children. The link component will add Recipe's styles and event handlers to that element. Actual navigation will be handled by the wrapped element.
To use with React Router
import {EzLink} from '@ezcater/recipe';import {Link as RouterLink} from 'react-router-dom';<EzLink><RouterLink to="/next-page">Next Page</RouterLink></EzLink>;
If the ReactNode provided to the link component is plain text, it will be styled and exposed to assistive technologies as a link. Interaction will need to be handled in JavaScript with the onClick
prop. Note: this will not behave like a native link. Browser features like context menus and open in new tab will not be available.
The secondary
link variant's subdued appearance is suitable when the primary variant is too overwhelming, such as in blocks of text with several references linked throughout.
The reset
link variant removes the browser default text decoration and color from the wrapped navigation element. This variant can be used to provide navigation semantics to other elements, such as headings or charts, without impacting their default appearance.