|
Download wp-calypso/packages/components/src/external-link/README.md from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/external-link/README.md
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/components/src/external-link/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/components/src/external-link/README.md
1.02 kB
| # External Link | |
| ## ExternalLink | |
| External Link is a React component for rendering an external link. | |
| ### Usage | |
| ```jsx | |
| import { ExternalLink } from '@automattic/components'; | |
| function MyComponent() { | |
| return ( | |
| <ExternalLink icon href="https://wordpress.org" onClick={ () => {} }> | |
| WordPress.org | |
| </ExternalLink> | |
| ); | |
| } | |
| ``` | |
| ### Props | |
| The following props can be passed to the External Link component: | |
| | property | type | required | comment | | |
| | ------------- | ------- | -------- | ------------------------------------------------------------------------------ | | |
| | `icon` | Boolean | no | Set to true if you want to render a nice external Gridicon at the end of link. | | |
| | `localizeUrl` | Boolean | no | Set to false if you want to render a link that is not localized. | | |
| ### Other Props | |
| Any other props that you pass into the `a` tag will be rendered as expected. | |
| For example `onClick` and `href`. |