2.1.2 • Published 5 months ago

solid-sortablejs v2.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Solid SortableJS

Easily sort your list. solid-sortablejs is using the SortableJS library to sort your list.
This library is in WIP

Quick start

Install it:

npm install solid-sortablejs

Use it:

import Sortable from "solid-sortablejs";
import {createStore} from "solid-js/store";
import { JSX } from "solid-js";

const App = () => {
  const itemStyles: JSX.CSSProperties = {"user-select": "none", background: "green", padding: "10px", "min-width": "100px", margin: "5px", "border-radius": "4px", color: "white"};
  const containerStyles = {display: "inline-block", background: "gray", padding: "10px", "border-radius": "4px"};

  const [items, setItems] = createStore([
    { id: 0, name: 0 },
    { id: 1, name: 1 },
    { id: 2, name: 2 },
    { id: 3, name: 3 },
  ])

  return (
    <div style={containerStyles}>
      <Sortable idField="id" items={items} setItems={setItems} >
        {item => <div style={itemStyles}>{item.name} {Math.random()}</div>}
      </Sortable>
    </div>
  );
};
2.1.2

5 months ago

2.1.1

5 months ago

2.1.0

8 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.7

1 year ago

2.0.6

1 year ago

2.0.9

1 year ago

2.0.8

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago