strudel/packages/react
2023-02-11 20:55:35 +01:00
..
examples/nano-repl trash obsolete package-lock files 2023-02-01 20:43:16 +01:00
src no autocomplete until upstream merge 2023-02-11 20:55:35 +01:00
.gitignore remove dist folder 2023-01-28 22:49:13 +01:00
.npmignore hotfix: npmignore react examples 2022-11-06 19:39:05 +01:00
index.html code format 2022-12-13 21:32:03 +01:00
package.json use jsdoc in autocomplete, still not context aware 2023-02-09 12:19:38 +01:00
postcss.config.js code format 2022-12-13 21:32:03 +01:00
README.md overhaul the remaining readmes 2023-02-01 16:29:18 +01:00
tailwind.config.js remove sc prefix to fix build 2023-02-01 15:35:21 +01:00
vite.config.js react build 2023-01-28 22:58:40 +01:00

@strudel.cycles/react

This package contains react hooks and components for strudel. It is used internally by the Strudel REPL.

Install

npm i @strudel.cycles/react

Usage

Here is a minimal example of how to set up a MiniRepl:

import { evalScope, controls } from '@strudel.cycles/core';
import { MiniRepl } from '@strudel.cycles/react';
import { prebake } from '../repl/src/prebake.mjs';

evalScope(
  controls,
  import('@strudel.cycles/core'),
  import('@strudel.cycles/tonal'),
  import('@strudel.cycles/mini'),
  import('@strudel.cycles/webaudio'),
  /* probably import other strudel packages */
);

prebake();

export function Repl({ tune }) {
  return <MiniRepl tune={tune} hideOutsideView={true} />;
}

For a more sophisticated example, check out the nano-repl!