npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@justeattakeaway/pie-select

v0.8.8

Published

PIE Design System Select built using Web Components

Downloads

2,636

Readme

@justeattakeaway/pie-select

Source Code | Design Documentation | NPM

@justeattakeaway/pie-select is a Web Component built using the Lit library. It offers a simple and accessible interactive select input 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 | |----------------|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------| | size | "small", "medium", "large" | The size of the select component. | medium | | disabled | boolean | Whether the select is disabled. | false | | assistiveText| string | An optional assistive text to display below the select element. Must be provided when the status is error. | undefined | | status | "default", "error" | The status of the select component / assistive text. | default | | name | string | The name of the select (used as a key/value pair with value). This is required in order to work properly with forms. | undefined | | options | array | The options to display in the select. Can be an array of option objects or option group objects. See Using the options prop for more details. | [] | | value | string | The programatically set value of the select. It overrides any option set as selected. | `` |

Using the options prop

The options prop accepts an array of option objects or option group objects:

Option objects

| Prop | Options | Description | Default | |------------|----------------|-------------------------------------------------|-------------| | tag | "option" | Must be option to identify this as an option. | undefined | | text | string | The text to display for the option. | undefined | | value | string | The value for the option. | undefined | | disabled | boolean | Whether the option is disabled. | false | | selected | boolean | Whether the option is selected by default. | false |

Option group objects

| Prop | Options | Description | Default | |------------|--------------|-------------------------------------------------------|-------------| | tag | "optgroup" | Must be optgroup to identify this as an option group. | undefined | | label | string | The label for the group. | undefined | | disabled | boolean | Whether the entire group is disabled. | false | | options | array | Array of option objects within this group. | [] |

Slots

| Slot | Description | |---------------|---------------------------------------------| | leadingIcon | An icon to display at the start of the select. |

CSS Variables

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

Events

| Event | Description | |---------|---------------------------------------------| | change| Fires when the selected option is changed. |

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 that will be loaded on the page where the component is used.
import '@justeattakeaway/pie-webc/components/select.js';
import '@justeattakeaway/pie-icons-webc/dist/IconPlaceholder.js';
<pie-select
    name="my-select"
    value="option2">
  <icon-placeholder slot="leadingIcon"></icon-placeholder>
</pie-select>
// Set options programmatically
const select = document.querySelector('pie-select');
select.options = [
  { tag: 'option', text: 'Select an option' },
  { tag: 'option', text: 'Option 1', value: 'option1' },
  { tag: 'option', text: 'Option 2', value: 'option2' }
];

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

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

<pie-select
    name="my-select"
    value="option2"
    :options="[
      { tag: 'option', text: 'Select an option' },
      { tag: 'option', text: 'Option 1', value: 'option1' }
      { tag: 'option', text: 'Option 2', value: 'option2' }
    ]">
<icon-placeholder slot="leadingIcon"></icon-placeholder>
</pie-select>

For React Applications:

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

<PieSelect
    name="my-select"
    value="option2"
    options={[
      { tag: 'option', text: 'Select an option' },
      { tag: 'option', text: 'Option 1', value: 'option1' },
      { tag: 'option', text: 'Option 2', value: 'option2' },
    ]}>
  <IconPlaceholder slot="leadingIcon"></IconPlaceholder>
</PieSelect>

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.