Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ngx-dummy/select-simple

A simple select (dropdown) component to use in Angular / Ionic projects
https://github.com/ngx-dummy/select-simple

angular angular11-component component-library dropdown ionic javascript options select select-component typescript ui ui-components

Last synced: 24 days ago
JSON representation

A simple select (dropdown) component to use in Angular / Ionic projects

Awesome Lists containing this project

README

        







@Ngx-dummy/Select-simple library


[![npm version](https://flat.badgen.net/npm/v/@ngx-dummy/select-simple?scale=1.5&color=f11&labelColor=F62&label=latest%20version&icon=npm)](https://www.npmjs.com/package/@ngx-dummy/select-simple)

---

[![GitHub license](https://img.shields.io/github/license/ngx-dummy/select-simple?style=flat-square)](https://github.com/ngx-dummy/select-simple/blob/main/LICENSE)

[![GitHub issues](https://img.shields.io/github/issues/ngx-dummy/select-simple?style=flat-square)](https://github.com/ngx-dummy/select-simple/issues)
[![GitHub forks](https://img.shields.io/github/forks/ngx-dummy/select-simple?style=flat-square)](https://github.com/ngx-dummy/select-simple/network)
[![GitHub stars](https://img.shields.io/github/stars/ngx-dummy/select-simple?style=flat-square)](https://github.com/ngx-dummy/select-simple/stargazers)
[![GitHub Release](https://flat.badgen.net/github/release/ngx-dummy/select-simple)](https://github.com/ngx-dummy/select-simple/releases)
[![GitHub Branches](https://flat.badgen.net/github/branches/ngx-dummy/select-simple)](https://github.com/ngx-dummy/select-simple/branches)
[![GitHub Tags](https://flat.badgen.net/github/tags/ngx-dummy/select-simple)](https://github.com/ngx-dummy/select-simple/tags)
[![GitHub Issues](https://flat.badgen.net/github/issues/ngx-dummy/select-simple)](https://github.com/ngx-dummy/select-simple/issues)
[![GitHub Forks](https://flat.badgen.net/github/forks/ngx-dummy/select-simple)](https://github.com/ngx-dummy/select-simple/network/members)
[![GitHub Status](https://flat.badgen.net/github/status/ngx-dummy/select-simple)](https://github.com/ngx-dummy/select-simple/network/members)
[![publish size](https://flat.badgen.net/packagephobia/publish/@ngx-dummy/select-simple)](https://bundlephobia.com/package/@ngx-dummy/select-simple)
[![min size](https://flat.badgen.net/bundlephobia/min/@ngx-dummy/select-simple)](https://bundlephobia.com/package/@ngx-dummy/select-simple)
[![minzip size](https://flat.badgen.net/bundlephobia/minzip/@ngx-dummy/select-simple)](https://bundlephobia.com/package/@ngx-dummy/select-simple)
[![Npm downloads](https://flat.badgen.net/npm/dt/@ngx-dummy/select-simple)](https://www.npmjs.com/package/@ngx-dummy/select-simple)
[![Npm monthly downloads](https://flat.badgen.net/npm/dm/@ngx-dummy/select-simple)](https://www.npmjs.com/package/@ngx-dummy/select-simple)
[![](https://data.jsdelivr.com/v1/package/npm/@ngx-dummy/select-simple/badge?style=flat-square)](https://www.jsdelivr.com/package/npm/@ngx-dummy/select-simple)
[![Twitter Follow](https://img.shields.io/twitter/follow/OvsyukovV.svg?style=flat-square&logo=twitter)](https://twitter.com/OvsyukovV)
[![Donations](https://img.shields.io/badge/Donate-PayPal-green.svg?style=flat-square)](https://paypal.me/ovsyukov)

---

[![npm-deploy](https://github.com/ngx-dummy/select-simple/actions/workflows/npm-deploy.yml/badge.svg?style=flat)](https://github.com/ngx-dummy/select-simple/actions/workflows/npm-deploy.yml)

[ngx-dummy.github.io/select-simple/](ngx-dummy.github.io/select-simple/)

## Features

This is an "Angular version" of html [select](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/select) (which could hardly be styled / templated ... hence the library)

- :gear: **Completely customizable:** you can change the colors, styles ...

- :pencil2: **Create your own templates:** create your own Options' templates

- :ok_hand: **You can use right away:** there are basic items styles included

- :rocket: **No extra deps:** depends only on `@angular/core / @angular/common`

- :satellite: **Options' Elements object bindings** data-bind `Option`s to **_string_** of complex objects


## Install

### Yarn

```bash
yarn add @ngx-dummy/select-simple
```

With Npm

```bash
npm install -save @ngx-dummy/[email protected]
```


## Usage

### See the sample app setup [Stackblitz](https://stackblitz.com/edit/ngx-dummyselect-simple-tester?file=src/app/app.component.html)

[![Using @ngx-dummy/select-simple](https://user-images.githubusercontent.com/969302/140906480-cc2b597d-7ac2-4c12-b752-61b8ba1c704b.png)](https://stackblitz.com/edit/ngx-dummyselect-simple-tester?file=src/app/app.component.html)


### samples

```ts
import { SelectSimpleModule } from '@ngx-dummy/select-simple';

@NgModule({
imports: [SelectSimpleModule],
})
export class AppModule {}
```

#### with `Options` (Array of Strings) binding:

```html

```

```ts
//... options as simple strings
options = ['opt1', 'opt2', 'opt2'];
//...
```


#### with `Options` (Array of Objects) and `optionLabelKey` (for resolving every options' caption) binding:

```html

```

```ts
//... Select-items's Captions resolved by `optionLabelKey` param (could be simple name of property key or, in case of nested property, dot-separated, ie, `value.para1` )
options = [{ name: 'opt1' , value: { param1: 'para1', param2: 'para2' } }, { name: 'opt2' , value: { param1: 'para1', param2: 'para2' } },];
//...
```


#### and `Option` are projected (content projection \ transclusion):

```html


```

```ts
//...
selected = undefined;
//...
```


More detailed showcase (the video clip demonstrates most of use cases of the library)

[![Using @ngx-dummy/select-simple](https://raw.githubusercontent.com/ngx-dummy/select-simple/v9/docs/Select-simple-usage.png)](https://vimeo.com/579375725/749b80e96c)





---




## Versioning

supports Angular 11 - 13.


-*v9
`@ngx-dummy/select-simple` versioned `*-v9` supports Angular 9 - 11.


## Browser Support

| [Chrome](http://godban.github.io/browsers-support-badges/)Chrome | [Firefox](http://godban.github.io/browsers-support-badges/)Firefox | [IE / Edge](http://godban.github.io/browsers-support-badges/)Edge | [Safari](http://godban.github.io/browsers-support-badges/)Safari | [Opera](http://godban.github.io/browsers-support-badges/)Opera |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| last 2 versions | last 2 versions | Edge versions | last 2 versions | last 2 versions |


## To support my work, maybe ..👏 🍭 :

Buy Me A Coffee


---


Other projects:

| Name | URL |
| :-----------: | :----------------------------------------: |
| **Accordion Simple** | *https://www.npmjs.com/package/@ngx-dummy/accordion-simple* |


---


#### Usage

Licensed under
[![GitHub license](https://img.shields.io/github/license/ngx-dummy/select-simple)](https://github.com/ngx-dummy/select-simple/blob/main/LICENSE)

Licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
\_Copyright (c) belongs to Vladimir Ovsyukov <>