Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 1.66 KB

File metadata and controls

44 lines (31 loc) · 1.66 KB

Solid Primitives selectors

@solid-primitives/selectors

turborepo size version stage

A sample primitive that is made up for templating with the following options:

createArraySelcetor - Provides a getter and setter for the primitive.

Installation

npm install @solid-primitives/selectors
# or
yarn add @solid-primitives/selectors
# or
pnpm add @solid-primitives/selectors

How to use it

const list: string[] = ["apple", "pear", "orange"]
const [selectedItems] = createSignal<string[]>(["apple"])
const isSelected = createArraySelector(selectedItems)

<For each={list}>
  {(item) => <li classList={{ active: isSelected(item) }}>{item}</li>}
</For>

Demo

You can use this template for publishing your demo on CodeSandbox: https://codesandbox.io/s/solid-primitives-demo-template-sz95h

Changelog

See CHANGELOG.md