Radio

Material Design 3 radio button web component (grouped selection, error, and form participation).

  • 2.9 KB gzipped
  • @lit-material/radio 0.0.5
  • Renders on the server

Example

Install

npm install @lit-material/radio @lit-material/tokens
import "@lit-material/radio";

Link @lit-material/tokens/css/index.css once per page for the colour, type and shape tokens. Install guide

API

<lit-material-radio>

Material Design 3 radio button.

Properties

PropertyAttributeTypeDefaultDescription
checkedcheckedbooleanfalse
disableddisabledbooleanfalse
errorerrorbooleanfalse
requiredrequiredbooleanfalse
namenamestring""
valuevaluestring"on"
formformstring | undefinednone
ariaLabelaria-labelstring | nullnullForwarded to the inner control; radios have no visible label so this is often required.
ariaLabelledByaria-labelledbystring | nullnull

Events

EventDescription
changeBubbles when this radio becomes checked via user interaction.

CSS parts

PartDescription
radioThe container the state layer, focus ring, and ring/dot are rendered in.
iconThe svg containing the outer ring and, when checked, the inner dot.
rippleThe state-layer element the hover/press feedback is drawn on.
focus-ringThe focus indicator element.

Source on GitHub npm