Skip to content

Instantly share code, notes, and snippets.

@silicakes
Last active December 31, 2018 15:20
Show Gist options
  • Save silicakes/d08c8989915177d5960c325d44645ee3 to your computer and use it in GitHub Desktop.
Save silicakes/d08c8989915177d5960c325d44645ee3 to your computer and use it in GitHub Desktop.
Framers code component template
import * as React from "react";
import { PropertyControls, ControlType } from "framer";
const style: React.CSSProperties = {
height: "100%",
display: "flex",
alignItems: "center",
justifyContent: "center",
textAlign: "center",
color: "#8855FF",
background: "rgba(136, 85, 255, 0.1)",
overflow: "hidden",
};
// Define type of property
interface Props {
text: string;
}
export class MyComponent extends React.Component<Props> {
// Set default properties
static defaultProps = {
text: "Hello World!"
}
// Items shown in property panel
static propertyControls: PropertyControls = {
text: { type: ControlType.String, title: "Text" },
}
render() {
return <div style={style}>{this.props.text}</div>;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment