Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save airandopal/427f9022bbf4327bae13d4e1b53916c8 to your computer and use it in GitHub Desktop.

Select an option

Save airandopal/427f9022bbf4327bae13d4e1b53916c8 to your computer and use it in GitHub Desktop.
Reuse Property Controls easily in Framer X
import { ControlType, PropertyControls } from "framer";
export function generatePropertyControls(
options: {
hidden?: (props: any) => boolean;
omittedProperties?: string[];
} = {}
): PropertyControls {
const properties: PropertyControls = {
// Property Controls go here
};
if (!!options.omittedProperties) {
return Object.keys(properties).reduce<PropertyControls>((acc, key) => {
if (options.omittedProperties.indexOf(key) === -1) {
acc[key] = properties[key];
}
return acc;
}, {});
}
return properties;
}
@qjoner
Copy link

qjoner commented Feb 1, 2024

export function Component(props) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment