svselect
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-fixes • Public • Published

🔍 svselect

Easy to use Select inputs.

Exports the Select component:

interface Param {
	label: string;
	key: string | number;
	custom?: boolean;
}

interface SelectParams {
	options?: Param[];
	multiple?: boolean;
	allowcreate?: boolean;
	hideselected?: boolean;
	onChange?: (
		newValue: Param[] | Param,
		oldValue: Param[] | Param
	) => boolean;
	selected?: Param[] | Param;
	placeholder?: string;
	id?: string;
	style?: string;
	getSelected?: () => Param[] | Param;
}

To use the getSelected function, use the bind:this derivative.

<script>
	// ... imports
	let selectBox; // call `selectBox.getSelected()`
</script>

<select bind:this="{selectBox}" allowcreate {options} />

OR

<script>
	// ... imports
	let getUserSelected; // call this whenever you want
</script>

<select bind:getSelected="{getUserSelected}" allowcreate {options} />

Made to fit in with Bootstrap. You should be able to integrate this seemlessly without a styling hassle.

Readme

Keywords

Package Sidebar

Install

npm i svselect

Weekly Downloads

1

Version

1.0.0-fixes

License

MIT

Unpacked Size

13.2 kB

Total Files

7

Last publish

Collaborators

  • battledash2