# All files / layouts/Form FormColumn.js

66.67% Statements 4/6
100% Branches 0/0
0% Functions 0/2
66.67% Lines 4/6

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54

    5x

    5x

    5x

    5x

     import PropTypes from 'prop-types';
    import styled from 'styled-components';

    const FormColumn = styled.section`
      padding: 0 ${({ theme }) => theme.padding.large};
      border-right: ${({ theme }) => theme.formColumn.border};

      &:first-of-type {
        padding-left: 0;
      }

      &:last-of-type {
        border-right: none;
        padding-right: 0;
      }
    `;

    FormColumn.propTypes = {
      /**
       * Adds an id to the element.
       */
      id: PropTypes.string,
      /**
       * Adds a class name to the element.
       */
      className: PropTypes.string,
    };

    FormColumn.defaultProps = {
      id: null,
      className: null,
    };

    FormColumn.usage = `
    # FormColumn

    Sometimes forms are split into vertical columns. Very rarely, but we still have a component for that.

    \`\`\`
    <Form>
      <FormColumn>
        <Field component={Foo} />
        <FieldGroup> ... </FieldGroup>
      </FormColumn>
      <FormColumn>
        <Field component={Bar} />
        <FieldGroup> ... </FieldGroup>
      </FormColumn>
    </Form>
    \`\`\`
    `;

    export default FormColumn;