{"id":13528286,"url":"https://github.com/tweakpane/use-tweaks","last_synced_at":"2025-04-01T11:31:15.316Z","repository":{"id":40000736,"uuid":"288798027","full_name":"tweakpane/use-tweaks","owner":"tweakpane","description":"🎛️ Tweak React components with Tweakpane","archived":false,"fork":false,"pushed_at":"2021-10-01T10:17:45.000Z","size":2139,"stargazers_count":759,"open_issues_count":9,"forks_count":22,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-05-02T00:19:02.466Z","etag":null,"topics":["creative-coding","gui","tweakpane","tweaks"],"latest_commit_sha":null,"homepage":"https://codesandbox.io/s/use-tweaks-example-58e02","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tweakpane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-19T17:43:57.000Z","updated_at":"2024-04-25T04:49:49.000Z","dependencies_parsed_at":"2022-06-26T07:31:19.781Z","dependency_job_id":null,"html_url":"https://github.com/tweakpane/use-tweaks","commit_stats":null,"previous_names":["gsimone/use-tweaks"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweakpane%2Fuse-tweaks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweakpane%2Fuse-tweaks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweakpane%2Fuse-tweaks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tweakpane%2Fuse-tweaks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tweakpane","download_url":"https://codeload.github.com/tweakpane/use-tweaks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246631828,"owners_count":20808764,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["creative-coding","gui","tweakpane","tweaks"],"created_at":"2024-08-01T06:02:23.749Z","updated_at":"2025-04-01T11:31:14.728Z","avatar_url":"https://github.com/tweakpane.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"![A screenshot of the library in use](https://i.imgur.com/A7yL1zE.jpg)\n[![npm](https://img.shields.io/npm/v/use-tweaks?style=flat-square)](https://www.npmjs.com/package/use-tweaks) ![npm](https://img.shields.io/npm/dt/use-tweaks.svg?style=flat-square) [![Discord Shield](https://discordapp.com/api/guilds/740090768164651008/widget.png?style=shield)](https://discord.gg/ZZjjNvJ)\n\nUse [Tweakpane](http://cocopon.github.io/tweakpane/) in React apps\n\n## Try it here on [Codesandbox](https://codesandbox.io/s/use-tweaks-example-ekqv2)\n\n```\nnpm install tweakpane use-tweaks\n```\n\n## Basic example\n\n```jsx\nimport { useTweaks } from \"use-tweaks\"\n\nfunction MyComponent() {\n  const { speed, factor } = useTweaks({\n    speed: 1,\n    factor: { value: 1, min: 10, max: 100 },\n  });\n\n  return (\n    \u003cdiv\u003e\n      {speed} * {factor}\n    \u003c/div\u003e\n  );\n}\n```\n\n## Misc\n\n#### Folders\n\nYou can add a top-level folder by passing the name as first argument of the hook:\n\n```jsx\nimport { useTweaks } from \"use-tweaks\"\n\nconst { speed, factor } = useTweaks(\"My title!\", { speed: 1, factor: 1 })\n```\n\nYou can also nest folders by using the `makeFolder` helper:\n\n```jsx\nimport { useTweaks, makeFolder } from \"use-tweaks\"\n\nconst { speed, factor } = useTweaks(\"My Title!\", {\n  speed: 1,\n  ...makeFolder(\n    \"Advanced\",\n    {\n      factor: 1,\n    },\n    false\n  ), // pass false to make the folder collapsed by default\n})\n```\n\n#### Buttons\n\nUse the `makeButton` helper to create and add a button\n\n```jsx\nimport { useTweaks, makeButton } from \"use-tweaks\"\n\nconst { speed, factor } = useTweaks({\n  speed: 1,\n  factor: { value: 1, min: 10, max: 100 },\n  ...makeButton(\"Log!\", () =\u003e console.log(\"Hello World!\"))\n})\n```\n\n#### Separator\n\nUse the `makeSeparator` helper to add a separator\n\n```jsx\nimport { useTweaks, makeSeparator } from \"use-tweaks\"\n\nconst { speed, factor } = useTweaks({\n  speed: 1,\n  ...makeSeparator(),\n  factor: { value: 1, min: 10, max: 100 },\n})\n```\n\n## License\n\nThis project is open source and available under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweakpane%2Fuse-tweaks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftweakpane%2Fuse-tweaks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftweakpane%2Fuse-tweaks/lists"}