Properties
Property | Type | Description |
---|---|---|
element | React.Element | (optional) Define what HTML or React element should be used (e.g. element={Link} ). Defaults to semantic a element. |
href | string | (optional) Relative or absolute url. |
to | string | (optional) Use this prop only if you are using a router Link component as the element that uses the to property to declare the navigation url. |
target | string | (optional) Defines the opening method. Use _blank to open a new browser window/tab. |
targetBlankTitle | string | (optional) The title shown as a tooltip when target is set to _blank . |
tooltip | string | (optional) Provide a string or a React Element to be shown as the tooltip content. |
icon | React.Node | (optional) Primary Icons can be set as a string (e.g. icon="chevron_right"), other icons should be set as React elements. |
iconPosition | string | (optional) left (default) or right . Places icon to the left or to the right of the text. |
noAnimation | boolean | (optional) Removes animations if set to true . Defaults to false . |
noHover | boolean | (optional) Removes hover effects if set to true . Defaults to false . |
noStyle | boolean | (optional) Removes styling if set to true . Defaults to false . |
noUnderline | boolean | (optional) Removes underline if set to true . Defaults to false . |
skeleton | boolean | (optional) If set to true , an overlaying skeleton with animation will be shown. |
Space | string object | (optional) Spacing properties like top or bottom are supported. |
Router Link
You can make use of the element
property in combination with the to
property.
import { Link } from 'gatsby'render(<Anchor to="/url" element={Link}>Link</Anchor>,)