Socket
Socket
Sign inDemoInstall

@material/react-radio

Package Overview
Dependencies
21
Maintainers
13
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @material/react-radio

Material Componens React Radio


Version published
Maintainers
13
Install size
3.06 MB
Created

Readme

Source

React Radio

A React version of an MDC Radio.

Installation

npm install @material/react-radio

Usage

Styles

with Sass:

import '@material/react-radio/index.scss';

with CSS:

import '@material/react-radio/dist/radio.css';

Javascript Instantiation

import React from 'react';
import Radio, {NativeRadioControl} from '@material/react-radio';

class MyApp extends React.Component {
  state = {petValue: null};

  render() {    
    return (
      <div>
        <Radio label='Dog' key='dog'>
          <NativeRadioControl
            name='pets'
            value='dog'
            id='dog'
            onChange={(e) => this.setState({petValue: e.target.value})}
          />
        </Radio>
        <Radio label='Cat' key='cat'>
          <NativeRadioControl
            name='pets'
            value='cat'
            id='cat'
            onChange={(e) => this.setState({petValue: e.target.value})}
          />
        </Radio>
    </div>
    );
  }
}

NOTE: The .mdc-radio element and the associated label are wrapped around an .mdc-form-field element for styling.

Radio Props

Prop NameTypeDescription
classNameStringClasses to be applied to the .mdc-radio element.
wrapperClassesStringClasses to be applied to the .mdc-form-field wrapper element.
labelStringLabel associated with radio input control.

NativeRadioControl Props

Prop NameTypeDescription
classNameStringClasses to be applied to the .mdc-radio element.
checkedBooleanDefault false. When true will switch radio to the checked state.
valueStringThe associated value with the radio element.
disabledBooleanDefault false. When true will disable the radio element.

Sass Mixins

Sass mixins may be available to customize various aspects of the Components. Please refer to the MDC Web repository for more information on what mixins are available, and how to use them.

Advanced Sass Mixins

Keywords

FAQs

Last updated on 22 Jul 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc