Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@material/mwc-radio
Advanced tools
<mwc-radio>
IMPORTANT: The Material Web Components are a work in progress and subject to major changes until 1.0 release.
Radio buttons allow the user to select one option from a set. Use radio buttons when the user needs to see all available options.
Material Design Guidelines: Radio buttons
npm install @material/mwc-radio
NOTE: The Material Web Components are distributed as ES2017 JavaScript Modules, and use the Custom Elements API. They are compatible with all modern browsers including Chrome, Firefox, Safari, Edge, and IE11, but an additional tooling step is required to resolve bare module specifiers, as well as transpilation and polyfills for IE11. See here for detailed instructions.
<mwc-radio name="myGroup" value="value1"></mwc-radio>
<mwc-radio name="myGroup" value="value2" checked></mwc-radio>
<script type="module">
import '@material/mwc-radio';
</script>
<style>
mwc-radio {
background-color: #363636;
--mdc-theme-secondary: #ff2929;
--mdc-radio-unchecked-color: white;
}
</style>
<mwc-radio name="myGroup" checked></mwc-radio>
<mwc-radio name="myGroup"></mwc-radio>
<style>
mwc-radio {
background-color: #363636;
--mdc-radio-disabled-color: #adadad;
}
</style>
<mwc-radio disabled name="myGroup"></mwc-radio>
<mwc-radio disabled name="myGroup" checked></mwc-radio>
Most applications should use
<mwc-formfield>
to associate an interactive label with the radio.
<style>
mwc-formfield {
display: block;
}
</style>
<mwc-formfield label="Home">
<mwc-radio name="location"></mwc-radio>
</mwc-formfield>
<mwc-formfield label="Work">
<mwc-radio name="location"></mwc-radio>
</mwc-formfield>
<script type="module">
import '@material/mwc-radio';
import '@material/mwc-formfield';
</script>
None
Name | Type | Default | Description |
---|---|---|---|
checked | boolean | false | Whether this radio button is the currently-selected one in its group. Maps to the native checked attribute. |
disabled | boolean | false | If true , this radio button cannot be selected or de-selected. Maps to the native disabled attribute. |
name | string | '' | Name of the input for form submission, and identifier for the selection group. Only one radio button can be checked for a given selection group. Maps to the native name attribute. |
value | string | '' | Value of the input for form submission. Maps to the native value attribute. |
global | boolean | false | If true , this radio button will use a global, document-level scope for its selection group rather than its local shadow root. |
reducedTouchTarget | boolean | false | When true , the radio removes touch target that extends beyond visual boundary of the component. Set to false by default to meet Material accessibility guidelines. |
None
Name | Detail | Description |
---|---|---|
change | {} | Fired when the user modifies the radio checked state from an input device interaction on this radio. Note that, like native <input> , the change event is not fired when the checked property is set from JavaScript, nor is it fired when another radio in the same group becomes checked . |
Name | Default | Description |
---|---|---|
--mdc-radio-unchecked-color | rgba(0, 0, 0, 0.54) | Color of the ring of an unchecked radio. |
--mdc-radio-disabled-color | rgba(0, 0, 0, 0.38) | Color of the ring and circle of a disabled radio. |
This component exposes the following global theming custom properties.
Name | Description |
---|---|
--mdc-theme-secondary | Color of the radio button. |
FAQs
Material Design radio web component
The npm package @material/mwc-radio receives a total of 2,785 weekly downloads. As such, @material/mwc-radio popularity was classified as popular.
We found that @material/mwc-radio demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 15 open source maintainers collaborating on the project.
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.