Skip to content

[request] Improved leva support #202

@Billiam

Description

@Billiam

Leva supports a couple of features that would be helpful to me, but that aren't really possible to use in replicad currently;

Folders (demo: https://leva.pmnd.rs/?path=/story/misc-folders--simple)

This would be helpful for organizing, grouping and collapsing related parameters. The data output for nested folders is still a flat list of parameters.

This would either require allowing user code to import leva's folder method, or would need some kind of static representation that replicad could parse and convert.

Conditional properties: https://leva.pmnd.rs/?path=/story/misc-input-options--render

This would be useful to hide or swap out one param for another, based on the value of another parameter.

This is enabled in leva with the render property on a parameter:

{
  myValue: {
    value: 5,
     render: get => true // not actually conditional
  },
  actuallyConditionalValue: {
     value: 10,
    render: get => get('myValue') > 5 
 }
}

This isn't possible in replicad currently because the configuration becomes unserializable for postMessage

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions