Skip to content

Instantly share code, notes, and snippets.

View pburtchaell's full-sized avatar

Patrick Burtchaell pburtchaell

View GitHub Profile
<form>
<input type="radio" id="answer-1" value="answer-1">
<label for="answer-1">My answer 1</label>
<input type="radio" id="answer-2" value="answer-2">
<label for="answer-2">My answer 2</label>
</form>
const leftText = "Hello"
// using props.chilren
const Button = (props) => (
<div>
{props.children}
</div>
)
<Button>
// Gets all design components exported from the canvas
export default function useDesignComponents() {
let canvas = require('../canvas.tsx')
let components = []
for (const key in canvas) {
if (!key.endsWith('__')) {
components = [...components, {
key: key,
/**
* @public
* Returns all design components
* */
export default function useCanvas() {
let components = null
let canvas = null
try {
// @ts-ignore
import * as React from "react"
import { useState } from "react"
function CodeComponent(props) {
const [color, setColor] = useState("blue")
return (
<Frame
background={color}
onTap={() = > {
@pburtchaell
pburtchaell / TapEventOverrides.tsx
Last active August 24, 2022 08:38
Double tap & long press event overrides for Framer X
import { Data, Override } from "framer"
const state = Data({
doubleTapIndex: 0,
doubleTapTimer: setTimeout(null, null),
longPress: false,
longPressTimer: setTimeout(null, null),
})
export function doubleTap(): Override {
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/