not-tinder-ui

not-tinder-ui

  • Docs

›Components

Get started

  • Introduction

Components

  • AddRemoveImage
  • Avatar
  • Card
  • ChatBubble
  • ChatInput
  • CustomSwitch
  • LabeledInput
  • LabeledRadioButtons
  • MediaCard
  • SwipeableWrapper

LabeledRadioButtons

Simple radio buttons group

Usage

LabeledRadioButtons_example

import React from 'react';
import { LabeledRadioButtons } from 'nottinderuikit';

const SampleLabeledRadioButtons = () => {
  const options = [{ value: '1', label: 'Pizza' }, { value: '2', label: 'Pasta' }, { value: '3', label: 'Sushi' },];
  const handleChange = (option: { value: string, label: string }) => {
    console.log(option);
  }
  return <LabeledRadioButtons label='Favourite food:' options={options} onChange={handleChange} />
}

export default SampleLabeledRadioButtons

Props

  • label
  • options
  • onChange
  • defaultSelectedValue

Reference

label

Label of the radio buttons group.

TypeDefaultRequired
stringundefinedtrue

options

Array of objects with the shape {value:"", label:""}, those objects will define the diferents radiobuttons. The value is a non user visible string, and the label is shown on the right of the radiobutton

TypeDefaultRequired
Array: {value:string, label:string}[]undefinedtrue

onChange

Function executed when the selected radiobutton changes.

TypeDefaultRequired
function: (option:{value:string, label:string}) => anyundefinedfalse

defaultSelectedValue

Value of the option we want to select by default

TypeDefaultRequired
stringundefinedfalse
← LabeledInputMediaCard →
  • Usage
  • Props
  • Reference
    • label
    • options
    • onChange
    • defaultSelectedValue
not-tinder-ui
Docs
Getting Started (or other categories)
More
GitHubStar
Facebook Open Source