2.0.0 • Published 4 months ago

@justeattakeaway/pie-icon-button v2.0.0

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

@justeattakeaway/pie-icon-button

Source Code | Design Documentation | NPM

@justeattakeaway/pie-icon-button is a Web Component built using the Lit library. It offers a simple and accessible icon button 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
aria{ label?: string }, { labelledby?: string }, { describedby?: string }, { expanded?: boolean }, { controls?: string }The ARIA attributes available to use on the icon button. Offers label, labelledby, describedby, expanded and controls.undefined
size"xsmall", "small", "medium", "large"Set the size of the icon button."medium"
variant"primary", "secondary", "outline", "ghost", "ghost-secondary", "inverse", "ghost-inverse"Set the variant of the icon button."primary"
disabledtrue, falseIf true, disables the icon button.false
isLoadingtrue, falseIf true, displays a loading indicator inside the icon button.false

Slots

SlotDescription
defaultThe default slot is used to pass an icon into the icon button component. Please use an icon from justeattakeaway/pie-icons-webc.

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

For HTML:

// import as module into a js file e.g. main.js
import '@justeattakeaway/pie-webc/components/icon-button.js';
import '@justeattakeaway/pie-icons-webc/dist/IconClose.js';
<!-- pass js file into <script> tag -->
<pie-icon-button onclick="e => console.log(e)">
  <icon-close></icon-close>
</pie-icon-button>
<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/icon-button.js';

<pie-icon-button @click="handleClick">
  <icon-close></icon-close>
</pie-icon-button>

For React Applications:

import { PieIconButton } from '@justeattakeaway/pie-webc/react/icon-button.js';
import { IconClose } from '@justeattakeaway/pie-icons-webc/dist/react/IconClose.js';

<PieIconButton onClick={handleClick}>
  <IconClose></IconClose>
</PieIconButton>

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.29.2

12 months ago

0.29.1

12 months ago

1.5.3

5 months ago

1.5.2

5 months ago

1.5.1

5 months ago

1.5.0

5 months ago

1.4.4

5 months ago

1.4.3

5 months ago

1.4.2

7 months ago

1.4.1

7 months ago

1.4.0

7 months ago

1.3.2

8 months ago

1.3.1

8 months ago

1.3.0

8 months ago

1.2.0

8 months ago

1.2.2

8 months ago

1.2.1

8 months ago

2.0.0

4 months ago

1.1.1

9 months ago

1.1.0

10 months ago

1.0.0

12 months ago

0.29.0

1 year ago

0.28.14

1 year ago

0.28.13

1 year ago

0.28.12

1 year ago

0.28.11

1 year ago

0.28.10

1 year ago

0.28.9

1 year ago

0.28.8

1 year ago

0.28.7

1 year ago

0.28.6

1 year ago

0.28.5

1 year ago

0.28.4

1 year ago

0.28.3

2 years ago

0.28.2

2 years ago

0.28.1

2 years ago

0.28.0

2 years ago

0.27.7

2 years ago

0.27.6

2 years ago

0.27.5

2 years ago

0.27.4

2 years ago

0.27.3

2 years ago

0.27.2

2 years ago

0.27.1

2 years ago

0.27.0

2 years ago

0.26.0

2 years ago

0.25.2

2 years ago

0.25.1

2 years ago

0.25.0

2 years ago

0.24.3

2 years ago

0.24.2

2 years ago

0.21.0

2 years ago

0.20.0

2 years ago

0.21.3-next.0

2 years ago

0.19.0

2 years ago

0.12.0

2 years ago

0.13.0

2 years ago

0.14.0

2 years ago

0.13.1

2 years ago

0.15.0

2 years ago

0.14.1

2 years ago

0.13.2

2 years ago

0.16.0

2 years ago

0.17.0

2 years ago

0.18.0

2 years ago

0.10.0

2 years ago

0.24.1

2 years ago

0.24.0

2 years ago

0.21.3

2 years ago

0.23.0

2 years ago

0.21.2

2 years ago

0.22.0

2 years ago

0.21.1

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.7.0

2 years ago

0.6.1

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