Last active
December 31, 2018 15:20
-
-
Save silicakes/d08c8989915177d5960c325d44645ee3 to your computer and use it in GitHub Desktop.
Framers code component template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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