1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-26 15:04:18 +00:00
pds-2021-g2-nest/code/frontend/src/components/LabelledForm.js

24 lines
753 B
JavaScript
Raw Normal View History

2021-04-22 17:10:19 +00:00
import React from "react"
import Style from "./LabelledForm.module.css"
import classNames from "classnames"
/**
* A form with two columns: the leftmost one contains labels, while the rightmost one contains input elements.
*
* The {@link Label} element can be used to quickly generate labelled input elements.
*
* @param children - The contents of the form.
* @param className - Additional class(es) to be added to the form.
* @param props - Additional props to be passed to the form.
* @returns {JSX.Element}
* @constructor
*/
2021-04-22 17:10:19 +00:00
export default function LabelledForm({ children, className, ...props }) {
return (
<form className={classNames(Style.LabelledForm, className)} {...props}>
{children}
</form>
)
}