Sleek Form

Sleek Form

  • Docs

›Components

Components

  • Text
  • Rating
  • Scale
  • Select
  • Question
  • Summary
  • Welcome
  • Radio
  • SleekFormThemProvider

Radio

  • Used to select a single state from multiple options.
  • The difference from Select is that Radio is visible to the user and can facilitate the comparison of choice, which means there shouldn't be too many of them.

Usage

const options: Array<Option> = [
  { key: 'A', value: 'male' },
  { key: 'B', value: 'female' },
  { key: 'C', value: 'transgender' },
];

<Radio
 name="gender"
 options={options}
 value="male"
 onChange={(e, value) => console.log(value)}
/>

Types

export type Option = { key: Char; value: string };

Props

The RadioField supports the following properties

PropsDescriptionTypeDefault
onChange?onChange callback(e: React.MouseEventnull, value: string) => void;None
value?Current selected radio option.stringNone
defaultValue?Initial selected radio option.stringNone
name?Name of the HTML InputstringNone
optionsarray of values of the radioArrayNone

Demo

You can view a live demo of RadioField in our sandbox

← WelcomeSleekFormThemProvider →
  • Usage
  • Types
  • Props
  • Demo
Sleek Form
Docs
Getting Started
More
GitHub
Copyright © 2020 Fresalabs