diff --git a/src/components/Radio.tsx b/src/components/Radio.tsx new file mode 100644 index 0000000..0157cd3 --- /dev/null +++ b/src/components/Radio.tsx @@ -0,0 +1,46 @@ +import React from "react"; +/** + * [*]This is a Radio component. + * + * [*]when you click on the label the radio will be selected + * + * [*] when you call this component pass the following: + * [1]. label + * [2]. id + * [3]. name + * + * [*] A good example will be: + * + */ +type RadioProps = { + /** + * the text that will be shown besie the radio + */ + label: string; + /** + * please provide a unique id + */ + id: string; + /** + * The name of radio element + */ + name: string; +} & Omit, "type">; + +const Radio = ({ label, id, name, ...props }: RadioProps) => { + return ( +
+ + +
+ ); +}; + +export default Radio;