Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
R

retoggle

> 编程语言
Open source

UI controls as React Hooks to control your component state from outside

1.4K stars0 likes0 views
WebsiteGitHub

About

UI controls as React Hooks to control your component state from outside


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.

  • A wide range of toggles
  • Frictionless integration
  • Themeable components
  • Extensible. Write your custom toggles.

Available knobs

  • useLog() - Keeps track of a variable value
  • useTextKnob() - Shows a text box
  • 1️⃣ useNumberKnob() - Shows a number box
  • ✅️ useBooleanKnob() - Shows a check box
  • useRangeKnob() - Shows a slider
  • useRangesKnob() - Shows multiple sliders
  • useSelectKnob() - Shows a select box
  • ⚒ useObjectKnob() - Shows an object editor
  • useColorKnob() - Shows a color picker
  • ⏰ useTimemachine() - Shows a slider and tracks the state of a given variable and allows to travel back in time

API Docs with live preview available here

Codesandbox Demo

An example

The value of state will be displayed in the inspector component.

javascript
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 (
    

  );
}

Contribute

Preparing dev environment

  • yarn install to install dev dependencies

Running and building the library

  • yarn start will start the dev server and expose the sample app
  • yarn build will output the build artifact to ./lib folder

Docs

  • docz:dev will start the docz development server
  • docz:build will build the docs

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScript

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言