0.12.5 • Published 8 months ago

@justeattakeaway/pie-chip v0.12.5

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

@justeattakeaway/pie-chip

Source Code | Design Documentation | NPM

@justeattakeaway/pie-chip is a Web Component built using the Lit library. It offers a simple and accessible chip 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
variant"default", "outline", "ghost"Sets the variant of the chip."default"
disabledtrue, falseIf true, disables the chip.false
isSelectedtrue, falseIf true, the chip component will apply the selected styles.false
isDismissibletrue, falseIf true, displays a close icon. Can be only used if isSelected is set to true.false
isLoadingtrue, falseIf true, displays a loading indicator inside the chip.false
aria{ label?: string, close?: string }Aria properties for the chip to help with making it accessible.undefined

Slots

SlotDescription
defaultThe default slot is used to pass text into the chip component.
iconUsed to pass an icon into the chip component.

CSS Variables

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

Events

EventTypeDescription
pie-chip-closeCustomEventTriggered when the user interacts with the close icon.

Visit Chip | PIE Design System to view more information on this component.

Usage Examples

For HTML:

// import as module into a js file e.g. main.js
import '@justeattakeaway/pie-webc/components/chip.js'
<pie-chip>String</pie-chip>

<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/chip.js';

<pie-chip>String</pie-chip>

For React Applications:

import { PieChip } from '@justeattakeaway/pie-webc/react/chip.js';

<PieChip>String</PieChip>

Icons

We recommend using @justeattakeaway/pie-icons-webc when using the icon slot. Here is an example of how you would do this:

<!--
  Note that pie-chip and the icons that you want to use will need to be imported as components into your application.
  See the `pie-icons-webc` README for more info on importing these icons.
-->
<pie-chip>
    <icon-vegan slot="icon"></icon-vegan>
    String
</pie-chip>

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.

0.9.7

11 months ago

0.9.4

1 year ago

0.9.3

1 year ago

0.9.6

11 months ago

0.9.5

12 months ago

0.10.1

11 months ago

0.10.2

11 months ago

0.10.0

11 months ago

0.11.0

10 months ago

0.11.1

10 months ago

0.11.2

10 months ago

0.11.3

9 months ago

0.11.4

8 months ago

0.9.2

1 year ago

0.9.1

1 year ago

0.12.0

8 months ago

0.12.1

8 months ago

0.12.2

8 months ago

0.12.3

8 months ago

0.12.4

8 months ago

0.12.5

8 months ago

0.9.0

1 year ago

0.8.5

1 year ago

0.8.4

1 year ago

0.8.6

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.7.2

1 year ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.3

2 years ago

0.6.4

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.4.0-alpha.0

2 years ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.0

2 years ago