@loykin/control-bar 0.0.1-dev.1 → 0.0.1-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +53 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,53 @@
1
+ # @loykin/control-bar
2
+
3
+ Persistent resizable bottom bar for React. Renders tab-based panels at the bottom of the viewport — like a VS Code terminal or browser DevTools.
4
+
5
+ ```bash
6
+ npm install @loykin/control-bar
7
+ ```
8
+
9
+ ```tsx
10
+ import {
11
+ ControlBarProvider,
12
+ ControlBar,
13
+ ControlBarBody,
14
+ registerTabType,
15
+ useControlBar,
16
+ } from '@loykin/control-bar'
17
+ import '@loykin/control-bar/styles'
18
+
19
+ // 1. Register tab types once (e.g. in your app entry)
20
+ registerTabType('log', { label: 'Logs', render: (data) => <LogViewer {...data} /> })
21
+
22
+ // 2. Wrap your app
23
+ <ControlBarProvider>
24
+ <ControlBarBody>{/* page content */}</ControlBarBody>
25
+ <ControlBar />
26
+ </ControlBarProvider>
27
+
28
+ // 3. Open tabs from anywhere
29
+ const { open } = useControlBar()
30
+ open({ type: 'log', data: { level: 'error' } })
31
+ ```
32
+
33
+ Or build a fully custom UI using just the hook — the default `ControlBar` component and CSS are optional:
34
+
35
+ ```tsx
36
+ function MyTabBar() {
37
+ const { tabs, activeTabId, activate, close } = useControlBar()
38
+ return (
39
+ <div className="my-tab-bar">
40
+ {tabs.map(tab => (
41
+ <button key={tab.id} onClick={() => activate(tab.id)}
42
+ className={tab.id === activeTabId ? 'active' : ''}>
43
+ {tab.label}
44
+ </button>
45
+ ))}
46
+ </div>
47
+ )
48
+ }
49
+ ```
50
+
51
+ React 18 and React 19 are supported. See the
52
+ [BaseKit repository](https://github.com/loykin/basekit) for all options, theming tokens,
53
+ and headless usage.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loykin/control-bar",
3
- "version": "0.0.1-dev.1",
3
+ "version": "0.0.1-dev.3",
4
4
  "description": "Persistent bottom control bar with typed tabs, resize, and Zustand state management.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -53,7 +53,7 @@
53
53
  "url": "https://github.com/loykin/basekit.git",
54
54
  "directory": "packages/control-bar"
55
55
  },
56
- "homepage": "https://loykin.github.io/basekit/playground/",
56
+ "homepage": "https://loykin.github.io/basekit/",
57
57
  "bugs": {
58
58
  "url": "https://github.com/loykin/basekit/issues"
59
59
  },