Radio
<pc-radio> Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.
Radios allow the user to select a single option from a radio group.
Additional demonstrations can be found in the radio group demos.
Eigenschaften#
| Name | Beschreibung | Reflektiert | Standard |
|---|---|---|---|
value | The radio’s value. When selected, the radio group will receive this value. Typ: string | undefined |
| ‐ |
size | The radio’s size. When used inside a radio group, the size will be determined by the radio group’s size so this attribute can typically be omitted. Typ: "small" | "medium" | "large" |
| "medium" |
disabled | Disables the radio. Typ: boolean |
| false |
updateComplete | Ein schreibgeschütztes Promise, das erfüllt ist, sobald die Komponente fertig aktualisiert wurde. | ‐ |
Erfahre mehr über Attribute und Eigenschaften.
Slots#
| Name | Beschreibung |
|---|---|
| (default) | The radio’s label. |
Erfahre mehr über die Benutzung von Slots.
Events#
| Name | Beschreibung | Event‐Detail |
|---|---|---|
pc-focus | Emitted when the radio gains focus. | ‐ |
pc-blur | Emitted when the radio loses focus (i.e., is blurred). | ‐ |
Erfahre mehr über Events.
Parts#
| Name | Beschreibung |
|---|---|
base | The component’s base wrapper. |
control | The circular container that wraps the radio’s checked state. |
control-checked | The circular container that wraps the radio’s checked state only if it’s checked. |
checked-icon | The checked icon, an <svg> element. |
label | The radio’s label. |
Erfahre mehr über das Anpassen von CSS‐Parts.
Importieren#
Wenn du den Autoloader oder den Standard‐Loader nutzt, kannst du diesen Abschnitt überspringen. Falls du „Cherry Picking“ betreibst, kannst du die folgenden Snippets verwenden, um diese Komponente zu importieren.
Um diese Komponente manuell vom CDN zu importieren, kopiere dieses Code‐Snippet und füge es in dein HTML ein.
<script type="module" src="https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.3/cdn/components/radio/radio.js"></script> Um diese Komponente manuell vom CDN zu importieren, kopiere dieses Code‐Snippet und füge es in deine JavaScript‐Datei ein.
import "https://cdn.jsdelivr.net/npm/placer-toolkit@1.0.0-alpha.3/cdn/components/radio/radio.js"; Um diese Komponente manuell via npm zu importieren, kopiere dieses Code‐Snippet und füge es in deine JavaScript‐Datei ein.
import "placer-toolkit/dist/components/radio/radio.js";