npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@movable/ember-radio-button

v3.0.0

Published

provides a radio-button component

Downloads

14

Readme

ember-radio-button Build Status Ember Observer Score

This addon provides a radio-button component.

A radio-button will be in a checked state when the value property matches the groupValue property. value should be unique per radio-button, while the same groupValue should be provided to each radio-button in the group.

Clicking on a radio-button will set groupValue to its value.

Usage

Block Form

The block form emits a label wrapping the input element and any elements passed to the block.

Template:

{{#radio-button
    value="blue"
    groupValue=color
    changed=(action "colorChanged")
}}
    <span>Blue</span>
{{/radio-button}}

/* results in */
<label id="ember346" class="ember-view ember-radio-button">
  <input id="ember347" class="ember-view" type="radio" value="blue">
  <span>Blue</span>
</label>

Non-block form

If you want more control over the DOM, the non-block form only emits a single input element

{{radio-button
    value="green"
    groupValue=color
    name="colors"
    changed=(action "colorChanged")
}}

/* results in */
<input id="ember345" class="ember-view" type="radio" value="green">

Examples in the test application

More example usage can be seen in the test application.

Supported Ember Versions

| ember-radio-button version | supports | |----------------------------|--------------------------| | 2.x | Ember 2.8+ | | 1.x | Ember 1.11+ |

Properties

Required:

| name | type | description | |------------|-----------|------------------------| | value | any |the unique value represented by the radio button | | groupValue | any |the value representing a radio group's current value. supply the same groupValue to every radio-button in a group |

Optional:

| name | type | description | |------------|-----------|------------------------| | ariaDescribedby | string | applies an aria-describedby attribute to the input element | | ariaLabelledby | string | applies an aria-labelledby attribute to the input element | | autofocus | boolean | applies the autofocus property to the input element | | checkedClass | string | classname to apply to the label element when the input it wraps is checked. block form only. defaults to "checked" | | classNames | string | applies additional classnames to the label element (block form only) | | disabled | boolean | applies the disabled property to the input element | | name | string | applies the name property to the input element | | radioClass | string | applies additional classnames to the input element | | radioId | string | sets the id of the input element and the for property to the label element | | required | boolean | applies the required property to the input element | | tabindex | number | applies a tabindex property to the input element |

Actions:

| name | description | |------------|------------------------| | changed | fires when user interaction causes a radio-button to update groupValue|

Installing

ember install ember-radio-button

Legacy Action Support

A string can be supplied for the changed property to enable legacy sendAction style action propagation.

Older versions of ember

ember-radio-button 1.0.0+ requires using htmlbars. Applications not using htmlbars should use version 0.1.3 or the pre-htmlbars branch.

Collaborating on this repo

  • git clone <repository-url> this repository
  • cd ember-radio-button
  • npm install

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.