@justeattakeaway/pie-icon-with-background
v0.2.1
Published
PIE Design System Icon With Background built using Web Components
Maintainers
Keywords
Readme
@justeattakeaway/pie-icon-with-background
Source Code | Design Documentation | NPM
@justeattakeaway/pie-icon-with-background is a Web Component built using the Lit library. It offers a simple and accessible icon-with-background 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
| Prop | Options | Description | Default |
|---------|--------------------------------------|-------------------------------------------------------------------------|----------|
| shape | circle, square | The shape of the background surrounding the icon. | circle |
| size | small, medium, large, xlarge | The size of the component, sizing both the container and slotted icon. | medium |
Slots
| Slot | Description | |-----------|-------------------------------------------------| | (default) | The icon to render inside the background shape. |
CSS Variables
This component does not expose any CSS variables for style overrides.
CSS Parts
| Part | Description |
|--------|------------------------------------|
| body | The main container of the component. |
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-with-background.js'<!-- pass js file into <script> tag -->
<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-with-background.js'
For React Applications:
import { PieIconWithBackground } from '@justeattakeaway/pie-webc/react/icon-with-background.js';
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.
