From 64c3d312626bbb79de314a4522d2953325a44cb4 Mon Sep 17 00:00:00 2001 From: Oh Xyz Date: Wed, 24 Jun 2026 13:38:53 +1000 Subject: [PATCH] docs: lead README with framework-free quick start, move dev setup to CONTRIBUTING --- CONTRIBUTING.md | 21 +++++++++++++++ README.md | 68 +++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 75 insertions(+), 14 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d1cd255 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,21 @@ +# Contributing + +## Development + +Install dependencies, then: + +```sh +pnpm install # first time only +pnpm dev # start the dev server +pnpm test # run the tests +``` + +## Environment + +Create a `.env.local` to set the default minimum width/height (in pixels) for a sash: + +```sh +# .env.local +VITE_DEFAULT_SASH_MIN_WIDTH=100 +VITE_DEFAULT_SASH_MIN_HEIGHT=100 +``` diff --git a/README.md b/README.md index b4b895a..9d35d74 100644 --- a/README.md +++ b/README.md @@ -3,28 +3,68 @@ [![Publish to npm](https://github.com/bhjsdev/bwin/actions/workflows/publish.yml/badge.svg)](https://github.com/bhjsdev/bwin/actions/workflows/publish.yml) [![npm version](https://img.shields.io/npm/v/bwin)](https://www.npmjs.com/package/bwin) -A lightweight window-tiling JavaScript library for the browser, featuring resizable panes, drag-and-drop, and more. +A lightweight window-tiling JavaScript library for the browser, featuring resizable panes, drag-and-drop, and more. Works with any framework or none. [![A bwin tiling layout with resizable panes showing charts and a data table](docs/screenshot.png)](https://bhjsdev.github.io/bwin-docs?theme=light) -[Documentation](https://bhjsdev.github.io/bwin-docs/javascript/get-started) +## Quick start -## Development +Drop this into an `.html` file and open it in your browser — no build step required: -Install dependencies, then: +```html + + + + + + + +
+ + +``` -Create a `.env.local` to set the default minimum width/height (in pixels) for a sash: +To install from npm instead: ```sh -# .env.local -VITE_DEFAULT_SASH_MIN_WIDTH=100 -VITE_DEFAULT_SASH_MIN_HEIGHT=100 +npm install bwin +``` + +```js +import { BinaryWindow } from 'bwin'; +import 'bwin/bwin.css'; ``` + +Installing from npm means using a bundler (Vite, webpack, Rollup, etc.) to build your app. + +## Documentation + +Full guides and API reference: [bhjsdev.github.io/bwin-docs](https://bhjsdev.github.io/bwin-docs/javascript/get-started) + +## Contributing + +See [CONTRIBUTING.md](CONTRIBUTING.md) for local development setup.