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

@ruc-lib/dual-list-selector

v2.0.5

Published

The Dual List Selector is a highly configurable Angular component that allows users to move items between two lists: an "available" list and a "selected" list. It's ideal for scenarios where users need to make multiple selections from a large set of optio

Readme

Dual List Selector

The Dual List Selector is a highly configurable Angular component that allows users to move items between two lists: an "available" list and a "selected" list. It's ideal for scenarios where users need to make multiple selections from a large set of options.

Features

  • Two-List Layout: Clearly separates available and selected items.
  • Drag and Drop: Intuitively move items between lists using Angular CDK Drag and Drop.
  • Button Controls: Move selected items, or all items, with button clicks.
  • Search: Filter items within both lists to quickly find what you're looking for.
  • Sorting: Sort items alphabetically in ascending or descending order.
  • Item Disabling: Prevent specific items from being moved.
  • State Persistence: Optionally persist the selected and available items in sessionStorage across page refreshes.
  • Customizable: Control dimensions and apply custom themes.

Dependencies

This library has peer dependencies on @angular/core, @angular/common, and @angular/material.

npm install @angular/material @angular/cdk

Installation Guide

To use the Dual List Selector component, you can install the entire RUC library or just this specific component.

Install the Entire Library

npm install @uxpractice/ruc-lib

Install Individual Component

If you only need the Dual List Selector component:

npm install @ruc-lib/dual-list-selector

Usage

  1. Import the Module In your Angular module file (e.g., app.module.ts), import the RuclibDualListSelectorModule:**

    import { RuclibDualListSelectorModule } from '@ruc-lib/dual-list-selector';
    import { FormsModule } from '@angular/forms';
    import { MatListModule } from '@angular/material/list';
    import { MatChipsModule } from '@angular/material/chips';
    import { DragDropModule } from '@angular/cdk/drag-drop';
    import { MatFormFieldModule } from '@angular/material/form-field';
    import { MatInputModule } from '@angular/material/input';
    import { MatIconModule } from '@angular/material/icon';
    import { MatSortModule } from '@angular/material/sort';
    import { MatTableModule } from '@angular/material/table';
    
    @NgModule({
      imports: [
        // ... other modules
        RuclibDualListSelectorModule,
        FormsModule,
        MatListModule,
        DragDropModule,
        MatChipsModule,
        MatFormFieldModule,
        MatInputModule,
        MatIconModule,
        MatSortModule,
        MatTableModule
      ]
    })
    export class YourModule { }
  2. In your component's template:

    <uxp-dual-list-selector
      [dataSource]="items"
      [rucInputData]="config"
      (rucEvent)="onSubmit($event)">
    </uxp-dual-list-selector>
  3. In your component's TypeScript file:

    import { Component } from '@angular/core';
    
    @Component({
      selector: 'app-your-component',
      templateUrl: './your-component.html',
    })
    export class YourComponent {
      // Configuration for the dual list
      config = {
        height: 450,
        width: 300,
        persistOnRefresh: true,
        enableSearch: true,
        sorting: true,
      };
    
      // Data for the dual list
      items = [
        { id: 1, name: 'Item 1', disable: true },
        { id: 2, name: 'Item 2', disable: true },
        { id: 3, name: 'Item 3', disable: false }, // This item cannot be moved
        { id: 4, name: 'Item 4', disable: true },
      ];
    
      onSubmit(selectedItems: any[]) {
        console.log('Submitted Items:', selectedItems);
        // Handle the submitted data
      }
    }

API Reference

Component Selector

<uxp-dual-list-selector>

Inputs

| Input | Type | Default | Description | | :------------- | :--------------- | :------ | :--------------------------------------------------------------------------------------- | | dataSource | Item[] | [] | An array of items to populate the lists. Each item should follow the Item interface. | | rucInputData | DualListConfig | {} | A configuration object for the component's features. See DualListConfig interface below. | | customTheme | string | '' | A custom CSS class name to be applied to the root element for theming purposes. |

Outputs

| Output | Type | Description | | :--------- | :-------------------- | :--------------------------------------------------------------------------------- | | rucEvent | EventEmitter<Item[]> | Emits an array of the currently selected items when the "Submit" button is clicked. |

Interfaces

DualListConfig

interface DualListConfig {
  height?: number;
  width?: number;
  persistOnRefresh?: boolean;
  enableSearch?: boolean;
  sorting?: boolean;
}

Item

interface Item {
  id: number | string;
  name: string;
  disable: boolean;
}

Contribution

Contributions are welcome! Feel free to open issues or pull requests for any enhancements or fixes.

Acknowledgements

Thank you for choosing the Dual List Selector component. If you have any feedback or suggestions, please let us know!