react-radio-ts
TypeScript icon, indicating that this package has built-in type declarations

0.0.12 • Public • Published

react-radio-ts

React radio.

Live Demo

Installation:

npm install react-radio-ts

or

yarn add -D react-radio-ts

Usage :

Add RadioGroup to your component:

import React, { FunctionComponent, useState } from "react";
import ReactDOM from "react-dom/client";
import { RadioGroup } from "react-radio-ts";

const options = [
  {
    label: "test1",
    value: "1",
  },
  {
    label: "test2",
    value: "2",
  },
  {
    label: "test3",
    value: "3",
  },
];
const Example: FunctionComponent = () => {
  const [value, setValue] = useState<string>("2");

  return (
    <div>
      <h2>React Radio TS default</h2>
      <RadioGroup
        direction="horizontal"
        name="group1"
        selectdValue={value}
        options={options}
        onChange={setValue}
      />
      <hr />
    </div>
  );
};

Package Sidebar

Install

npm i react-radio-ts

Weekly Downloads

3

Version

0.0.12

License

MIT

Unpacked Size

23 kB

Total Files

21

Last publish

Collaborators

  • francescodbc