hirohe / tweakpane-plugin-search-list

plugin for tweakpane, searchable select list

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tweakpane plugin Search list

version

This is a plugin for Tweakpane.

add searchable select list for tweakpane.

required version tweakpane@3.x

Install

npm i tweakpane-plugin-search-list
# or
yarn add tweakpane-plugin-search-list

Usage

import { Pane } from 'tweakpane';
import TweakpaneSearchListPlugin from 'tweakpane-plugin-search-list';

const pane = new Pane();
pane.registerPlugin(TweakpaneSearchListPlugin);

const data = { language: 'JavaScript' };
pane.addInput(data, 'language', {
  // use search-list
  view: 'search-list',
  options: {
    JavaScript: 'JavaScript',
    TypeScript: 'TypeScript',
    Java: 'Java',
    Go: 'Go',
    Dart: 'Dart',
    'C++': 'C++',
    'Object C': 'Object C',
    'C#': 'C#',
    Python: 'Python'
  }
});
// ...

Options

pane.addInput(data, 'field', {
  view: 'search-list',
  options: {
    // ...
  },
  noDataText: 'no data',
  debounceDelay: 250,
});
param description type default
noDataText text to show if no options matched string 'no data'
debounceDelay delay time to apply on lodash.debounce, for debounce search number 250

CSS variables

:root {
  --tp-plugin-select-box-bg-color: --input-background-color;
  --tp-plugin-select-no-data-color: #fff;
  --tp-plugin-select-option-bg-hover: rgb(129, 129, 129);
}

About

plugin for tweakpane, searchable select list

License:MIT License


Languages

Language:TypeScript 60.7%Language:JavaScript 27.8%Language:SCSS 7.0%Language:HTML 4.4%