0.2.2 • Published 6 months ago

multicomplete v0.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago
pnpm add multicomplete

Features

  • 📦 Tiny - 1.5kb gzipped
  • 🎨 Customizable - style it to your needs
  • ♿ Accessible - fully wai-aria compliant
  • 📖 Typescript - written in typescript
  • 📱 Mobile - works on mobile devices
  • 🌙 Themeable - use your own theme
  • 📚 Examples - examples for different scenarios

Usage

Import the hook and use it in your component.

import { useMultiComplete } from 'multicomplete'

const handlers = useMultiComplete({
  options,
  values,
  onChange,
  id,
  isOpen,
  onOpenChange,
})

Helpers

There are helpers to make working with complex data values easier.

import {
  createSubstringFilter,
  createEqualityFunction
} from 'multicomplete'

type Item = {
  id: string
  name: string
}

const isEqual = createEqualityFunction<Item>(v => v.id)
// a.k.a. a.id === b.id

const filter = createSubstringFilter<Item>(v => v.name)
// a.k.a. value.name.toLowerCase().includes(query.toLowerCase())
0.2.2

6 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.1.1

6 months ago

0.1.0

6 months ago