1.2.4 • Published 5 months ago

@justeattakeaway/pie-link v1.2.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

@justeattakeaway/pie-link

Source Code | Design Documentation | NPM

@justeattakeaway/pie-link is a Web Component built using the Lit library. It offers a simple and accessible link component for web applications.

Table of Contents

Installation

To install any of our web components in your application, we would suggest following the getting started guide to set up your project.

Ideally, you should install the component using the @justeattakeaway/pie-webc package, which includes all of the components. Or you can install the individual component package.

Documentation

Properties

PropOptionsDescriptionDefault
size"small", "medium"Sets the size of the link."medium"
variant"default", "high-visibility", "inverse"Sets the variant of the link."default"
tag"a", "button"Which HTML tag to use for the link."a"
hrefThe href attribute to apply.Cannot be used if tag is set to "button".undefined
targetThe target attribute to apply.Cannot be used if tag is set to "button".undefined
relThe rel attribute to apply.Cannot be used if tag is set to "button".undefined
type"button", "reset", "submit"The type attribute to apply when tag is set to "button"."submit"
underline"default", "reversed"The underline behaviour of the link. The default behaviour has the link text underlined, with the underline disappearing on hover. "reversed" will only take effect if isStandalone is set to true."default"
isBoldtrue, falseIf true, makes the link text bold.false
isStandalonetrue, falseIf true, sets the link as a block element.false
hasVisitedtrue, falseIf true, the link will apply the styles for the visited state. Only takes effect if tag is "a".false
iconPlacement"leading", "trailing"Sets the position of the icon relative to the text. Leading comes before the text and trailing comes after, taking writing direction into account. To use this, you must pass an icon into the icon slot. Will have no effect if isStandalone is false.undefined
aria{ label?: string }Aria properties for the link to help with making it accessible.undefined

Slots

SlotDescription
defaultThe default slot is used to pass text into the link component.
iconUsed to pass in an icon to the link component. The icon placement can be controlled via the iconPlacement prop and we recommend using pie-icons-webc for defining this icon. Please note the icon size is hardcoded and cannot be overridden.

CSS Variables

This component does not expose any CSS variables for style overrides.

Events

This component does not emit any custom events. In order to add event listening to this component, you can treat it like a native HTML element in your application.

Usage Examples

When using icons, we recommend using @justeattakeaway/pie-icons-webc to ensure consistency with the rest of the design system.

For HTML:

// import as module into a js file e.g. main.js
import '@justeattakeaway/pie-webc/components/link.js'
import '@justeattakeaway/pie-icons-webc/dist/IconPlaceholder.js';
<!-- pass js file into <script> tag -->
<pie-link href="https://www.pie.design">
  <icon-placeholder slot="icon"></icon-placeholder>
  pie.design
</pie-link>
<script type="module" src="/main.js"></script>

For Native JS Applications, Vue, Angular, Svelte etc.:

// Vue templates (using Nuxt 3)
import '@justeattakeaway/pie-webc/components/link.js';
import '@justeattakeaway/pie-icons-webc/dist/IconPlaceholder.js';

<pie-link href="https://www.pie.design">
  <icon-placeholder slot="icon"></icon-placeholder>
  pie.design
</pie-link>

For React Applications:

import { PieLink } from '@justeattakeaway/pie-webc/react/link.js';
import { IconPlaceholder } from '@justeattakeaway/pie-icons-webc/dist/react/IconPlaceholder.js';

<PieLink href="https://www.pie.design">
  <IconPlaceholder slot="icon" />
  pie.design
</PieLink>

Questions and Support

If you work at Just Eat Takeaway.com, please contact us on #help-designsystem. Otherwise, please raise an issue on Github.

Contributing

Check out our contributing guide for more information on local development and how to run specific component tests.

1.2.0

5 months ago

1.2.4

5 months ago

1.2.3

5 months ago

1.2.2

5 months ago

1.2.1

5 months ago

1.1.1

7 months ago

1.1.0

7 months ago

0.18.3

12 months ago

1.0.1

8 months ago

1.0.0

12 months ago

0.18.1

1 year ago

0.18.2

1 year ago

0.18.0

1 year ago

0.17.5

1 year ago

0.17.6

1 year ago

0.17.7

1 year ago

0.17.8

1 year ago

0.17.4

1 year ago

0.17.3

2 years ago

0.17.2

2 years ago

0.17.1

2 years ago

0.17.0

2 years ago

0.16.0

2 years ago

0.15.4

2 years ago

0.15.3

2 years ago

0.15.2

2 years ago

0.15.1

2 years ago

0.15.0

2 years ago

0.14.1

2 years ago

0.14.0

2 years ago

0.13.0

2 years ago

0.12.2

2 years ago

0.12.1

2 years ago

0.12.0

2 years ago

0.11.3

2 years ago

0.11.2

2 years ago

0.11.2-next.0

2 years ago

0.11.1

2 years ago

0.11.0

2 years ago

0.10.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.0

2 years ago