Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svelte-radio

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-radio

Customizable radio button component for Svelte

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-81.82%
Maintainers
1
Weekly downloads
 
Created
Source

svelte-radio

NPM Build

Customizable radio button component for Svelte.

Install

yarn add -D svelte-radio

Usage

<script>
  import Radio from "svelte-radio";

  let value = "1";
</script>

<Radio.Group bind:value>
  <Radio.Button label="Label 1" value="1" />
  <Radio.Button label="Label 2" value="2" />
  <Radio.Button label="Label 3" value="3" />
</Radio.Group>

API

Radio.Group

Property nameValue
legendstring
valuestring (default: undefined)
...$$restProps(forward to the top-level fieldset element)

Radio.Button

Property nameValue
labelstring
valuestring (default: undefined)
checkedboolean (default: false
...$$restProps(forward to the second-level input element)

Forwarded events

Radio.Group

Event nameDescription
on:changetriggered if the selection changes
<Radio.Group on:change={({ detail }) => { console.log(detail); }} />
<!--
    {
      "selected": {
        "id": string,
        "value": string,
        "label": string,
        "checked": true
      }
    }
  -->

Radio.Button

<Radio.Button on:focus on:blur on:change on:keydown />

Changelog

License

MIT

Keywords

FAQs

Package last updated on 13 Apr 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc