You are viewing a PR preview for PR #1506

Agriculture Design System
Beta
Design System for the Export Service

Direction link

Direction links are links which communicate flow to other parts of a page or process.

View in FigmaView in StorybookView in Github
import { ... } from '@ag.ds-next/react/direction-link';

Usage

Direction link components can be imported via the direction-link entrypoint in the @ag.ds-next/react package.

For example:

import { ... } from '@ag.ds-next/react/direction-link';

Props

DirectionLink Props
PropTypeDescription
directionDirectionThe direction of the link.
aria-label?stringDescribes the anchor element to assistive technologies.
children?ReactNode
download?anyCauses the browser to treat the linked URL as a download.
href?stringThe URL that the hyperlink points to.
id?stringThe ID of the hyperlink.
referrerPolicy?HTMLAttributeReferrerPolicyHow much of the referrer to send when following the link.
rel?stringThe relationship of the linked URL as space-separated link types.
role?AriaRoleWAI-ARIA role.
target?HTMLAttributeAnchorTargetWhere to display the linked URL, as the name for a browsing context (a tab, window, or <iframe>).
DirectionButton Props
PropTypeDescription
directionDirectionThe direction of the link.
aria-controls?stringIdentifies the element (or elements) whose contents or presence are controlled by the current element.
aria-describedby?stringIdentifies the element (or elements) that describes the object.
aria-expanded?BooleanishIndicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
aria-label?stringDescribes the button element to assistive technologies.
children?ReactNode
disabled?booleanWhen true, prevents onClick from firing.
id?stringDefines an identifier (ID) which must be unique.
onBlur?FocusEventHandler<HTMLButtonElement>Function to be fired following a blur event of the button.
onClick?MouseEventHandler<HTMLButtonElement>Function to be fired following a click event of the button.
onFocus?FocusEventHandler<HTMLButtonElement>Function to be fired following a focus event of the button.
onKeyDown?KeyboardEventHandler<HTMLButtonElement>Function to be fired following a keydown event of the button.
role?AriaRoleWAI-ARIA role.
tabIndex?numberThe `tabIndex` attribute of the button.
type?"button" | "reset" | "submit"The `type` attribute of the button.

Source

You can view the full source code for this package on Github.