Using Grommet for HPE?See Anchor examples and guidance.
How to align along the cross axis when contained in a Box or along the column axis when contained in a Grid.
string
"start"
"center"
"end"
"stretch"
"baseline"
The DOM tag or react component to use for the element.
string
The name of a component.
"div"
function
() => {}
component
{Component}
Label color and icon color, if not specified on the icon.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The amount of spacing between icon and label in the anchor.
string
T-shirt sizing based off the theme or a specific size in px, em, etc.
"xxsmall"
"string"
Label text to place in the anchor.
string
"Add"
element
A component used to display the label.
<Box>...</Box>
The amount of margin around the component.
string
"none"
"xxsmall"
"xsmall"
"small"
"medium"
"large"
"xlarge"
object
Can be specified to distinguish horizontal margin, vertical margin, and margin on a particular side.
{ vertical: "...", horizontal: "...", top: "...", bottom: "...", left: "...", right: "..." }
Click handler. It can be used, for example, to add analytics and track who clicked in the anchor.
function
( ) => { }
Whether an icon and label should be reversed so that the icon is at the end of the anchor.
boolean
true
false
The font size is typically driven by the components containing this component. But, it can be adjusted directly via this size property, typically when it is not contained in a 'Heading', 'Paragraph', or 'Text'.
string
T-shirt sizing based off the theme or a specific size in px, em, etc.
"xsmall"
"small"
"medium"
"large"
"xlarge"
"xxlarge"
"12px"
At its core, the Anchor component is a regular <a> element. Thus, both DOM and React properties, methods, and events are accessible. To read up on all of the possible DOM attributes and types available for a elements, check out this MDN Web Documents page. To learn more about DOM events and methods, you can read more on the MDN Web Events documentation page.
Also, feel free to read about the types of React events available, or see how DOM attributes change in React. Working in tandem with Styled Components, you also have access to the as property.
The color of the label text and icon strokes.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light mode.
{"dark": "black", "light": "brand"}
The gap between the label and icon.
string
T-shirt sizing based off the theme or a specific size in px, em, etc.
"none"
"xsmall"
"small"
"medium"
"large"
"xlarge"
"20 px"
The color of the icon.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The text decoration of the label. Refer to MDN for possible values.
string
"none"
The text decoration of the label when hovering. Refer to MDN for possible values.
string
"underline"
Any additional style for the Anchor when hovering.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}
The color of the icon.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light mode.
{"dark": "black", "light": "brand"}
Any additional style for the Anchor.
string
Any CSS.
css`color: 'blue'`
function
(props) => {}
The color of the label text and icon strokes on different Anchor sizes. Size refers to the text size of the Anchor.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light mode.
{"dark": "black", "light": "brand"}
The font weight of the label on different Anchor sizes. Size refers to the text size of Anchor.
number
300
The text decoration of the label when hovering on different Anchor sizes. Size refers to the text size of Anchor.
string
"underline"
The border color of the component when in focus.
string
A hex, name, or rgb value.
"focus"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The outline color around the component when in focus.
string
A hex, name, or rgb value.
"brand"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }
The shadow color around the component when in focus.
string
"focus"
object
An object with a color for dark and light modes.
{ dark: "string", light: "string" }