
Retoggle is a collection of React hooks which provides UI toggles to manipulate your component state from outside. Like Storybook Knobs. This library is inspired by ideas from Dan Abramov.
useLog() - Keeps track of a variable valueuseTextKnob() - Shows a text boxuseNumberKnob() - Shows a number boxuseBooleanKnob() - Shows a check boxuseRangeKnob() - Shows a slideruseRangesKnob() - Shows multiple slidersuseSelectKnob() - Shows a select boxuseObjectKnob() - Shows an object editoruseColorKnob() - Shows a color pickeruseTimemachine() - Shows a slider and tracks the state of a given variable and allows to travel back in timeThe value of state will be displayed in the inspector component.
import React, { useState } from "react";
import { Inspector, useLog } from "retoggle";
export default function Demo() {
const [state, setState] = useState({ value: 5 });
// logs your state to inspector
useLog("My state", state);
return (
<Inspector />
);
}
Preparing dev environment
yarn install to install dev dependenciesRunning and building the library
yarn start will start the dev server and expose the sample appyarn build will output the build artifact to ./lib folderDocs
docz:dev will start the docz development serverdocz:build will build the docsMIT
| [
Raathigeshan](https://twitter.com/Raathigesh)
💻 📖 💬 👀 🤔 🎨 | [
Het Patel](http://hetpatel33.github.io)
💻 | | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
This project follows the all-contributors specification. Contributions of any kind are welcome!
$ claude mcp add retoggle \
-- python -m otcore.mcp_server <graph>