Skip to content

Instantly share code, notes, and snippets.

@xcoderzach
Created January 10, 2017 20:31
Show Gist options
  • Save xcoderzach/9754c27af72a8cdbef65c1fcde322c61 to your computer and use it in GitHub Desktop.
Save xcoderzach/9754c27af72a8cdbef65c1fcde322c61 to your computer and use it in GitHub Desktop.
import React from 'react'
import * as ui from './ui'
export default const FormField = ({
Container = ui.Container,
Label = ui.Label,
Input = ui.Input
}) =>
({ type, label, value, onChange }) => (
<Container>
<Label>{label}</Label>
<Input type={type} value={value} onChange={onChange} />
</Container>
)
}
import styled from 'styled-components'
export const Container = styled.div`
margin: 20px;
`
export const Input = styled.input`
border: 1px solid tomato;
background-color: cream;
`
export const Label = styled.label`
font-size: 12px;
`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment