@primer/react
Version:
An implementation of GitHub's Primer Design System using React
62 lines • 2.25 kB
TypeScript
import React from 'react';
import type { SxProp } from '../sx';
import { FormControlCaption } from './FormControlCaption';
export type FormControlProps = {
children?: React.ReactNode;
/**
* Whether the control allows user input
*/
disabled?: boolean;
/**
* The unique identifier for this control. Used to associate the label, validation text, and caption text
*/
id?: string;
/**
* If true, the user must specify a value for the input before the owning form can be submitted
*/
required?: boolean;
/**
* The direction the content flows.
* Vertical layout is used by default, and horizontal layout is used for checkbox and radio inputs.
*/
layout?: 'horizontal' | 'vertical';
className?: string;
} & SxProp;
declare const _default: React.ForwardRefExoticComponent<{
children?: React.ReactNode;
/**
* Whether the control allows user input
*/
disabled?: boolean;
/**
* The unique identifier for this control. Used to associate the label, validation text, and caption text
*/
id?: string;
/**
* If true, the user must specify a value for the input before the owning form can be submitted
*/
required?: boolean;
/**
* The direction the content flows.
* Vertical layout is used by default, and horizontal layout is used for checkbox and radio inputs.
*/
layout?: "horizontal" | "vertical";
className?: string;
} & SxProp & React.RefAttributes<HTMLDivElement>> & {
Caption: typeof FormControlCaption;
Label: React.FC<React.PropsWithChildren<({
htmlFor?: string;
} & ((import("../internal/components/InputLabel").LabelProps | import("../internal/components/InputLabel").LegendOrSpanProps) & {
children?: React.ReactNode | undefined;
})) & {
visuallyHidden?: boolean;
requiredText?: string;
requiredIndicator?: boolean;
id?: string;
className?: string;
} & SxProp>>;
LeadingVisual: React.FC<React.PropsWithChildren<SxProp>>;
Validation: React.FC<React.PropsWithChildren<import("./_FormControlValidation").FormControlValidationProps>>;
};
export default _default;
//# sourceMappingURL=FormControl.d.ts.map