formik-stepper
Version:
Get ready to take your form-building game to the next level with this revolutionary React component. With its seamless integration with the powerful Formik library, you'll be building forms faster and more efficiently than ever before. But that's not all
34 lines (33 loc) • 891 B
TypeScript
import { FieldInputProps, FieldMetaProps } from "formik";
import React from "react";
export type FieldProps = {
[key: string]: any;
name: string;
label: string;
labelColor?: `#${string}`;
};
export type ComponentProps = {
field: FieldInputProps<any>;
meta: FieldMetaProps<any>;
label: string;
};
export type InputFieldProps = {
floating?: boolean;
component?: (props: ComponentProps) => JSX.Element;
} & FieldProps;
export type RadioFieldProps = {
component?: (props: ComponentProps) => JSX.Element;
style?: React.CSSProperties;
options: {
label: string;
value: any;
disabled?: boolean;
labelColor?: `#${string}`;
}[];
} & FieldProps;
export type SelectFieldProps = {
readonly?: boolean;
isMulti?: boolean;
options: any[];
component?: (props: ComponentProps) => JSX.Element;
} & FieldProps;