# botion

> Notion like data component

Latest version **0.0.3** (published 2023-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install botion
pnpm add botion
yarn add botion
bun add botion
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2023-04-27 |
| First published | 2023-04-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 6.5 MB |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| Author | Kim Wong |
| Maintainers | kimixwong |
| Keywords | react, typescript |

## Links

- npm: https://www.npmjs.com/package/botion
- Repository: https://github.com/nickjazz/Botion
- Homepage: https://github.com/nickjazz/Botion#readme
- Issues: https://github.com/nickjazz/Botion/issues
- npm.io page: https://npm.io/package/botion

## Dependencies (10)

- [lodash](https://npm.io/package/lodash.md) ^4.17.21
- [nanoid](https://npm.io/package/nanoid.md) ^4.0.2
- [classnames](https://npm.io/package/classnames.md) ^2.3.2
- [sortablejs](https://npm.io/package/sortablejs.md) 1.14
- [react-icons](https://npm.io/package/react-icons.md) ^4.8.0
- [tailwindcss](https://npm.io/package/tailwindcss.md) ^3.3.1
- [react-feather](https://npm.io/package/react-feather.md) ^2.0.10
- [react-draggable](https://npm.io/package/react-draggable.md) ^4.4.5
- [react-sortablejs](https://npm.io/package/react-sortablejs.md) 6.1.1
- [@radix-ui/react-popover](https://npm.io/package/@radix-ui/react-popover.md) ^1.0.5

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2023-04-27
- 0.0.2 — 2023-04-25
- 0.0.1 — 2023-04-23

## README

# Botion

### Data table inspired by Notion

![alt text](public/screenshot.jpg "Botion")

#### Features:

- Display as Table and List formats.
- List view includes the ability to mark items with an icon.
- Table view allows sorting, filtering, and defining icons.

---

### Usage

1. Add botion to your app

```
yarn add botion
```

2. And added this to my tailwind.config.js file:

```js
module.exports = {
  content: [
   "./pages/**/*.{js,ts,jsx,tsx,mdx}",
   "./components/**/*.{js,ts,jsx,tsx,mdx}",
   "./app/**/*.{js,ts,jsx,tsx,mdx}",
 + "./node_modules/botion/dist/*/**/*.{js,ts,jsx,tsx}",
  ],
```

```jsx
export default function Page() {
  const [active, setActive] = useState(0);
  const [tabData, setTabData] = useState<any>(data);

  const handleClick = (e) => {};

  return (
    <main className='w-full max-w-4xl mx-auto py-10 bg-white min-h-screen'>
      <Botion
        data={tabData}
        active={active}
        onClick={setActive}
        onChange={setTabData}
        onItemClick={handleClick}
      />
    </main>
  );
```

### Data format

```js
const data = [
	{
		type: "table", // table or list
		name: "just a list", // display on tab
		data: {
			head: [
        {
          id: 'a871id';
          icon: 'string'; // refer https://github.com/feathericons/react-feather
          data: 'weather';
          type: string; // string, checkbox, select
          width?: number; // column width
          wrap?: boolean; // text wrapping
          hidden?: boolean; // hidden in view
        }
      ],
			body: [
        {
          a871id: 'summer days' // key must a match head.id
        }
      ],
		},
	},
	{
		type: "table",
		name: "Member",
		data: {
			head: [],
			body: [],
		},
	},
];


interface headPropTypes {
	id: string;
	icon: string;
	data: string;
	type: string;
	width?: number;
	wrap?: boolean;
	locked?: boolean;
	hidden?: boolean;
}

```

---
_Source: https://npm.io/package/botion · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
