Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/radio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ import {

Standard radio buttons are the default style for radio buttons. They are optimal for application panels where all visual elements are monochrome in order to direct focus to the content.

Invalid selections in radio groups are identified using the `negative-help-text` slot. Read more about using [help text](#help-text) below.

```html-live
<div style="display: flex; justify-content: space-between;">
<div style="display: flex; flex-direction: column;">
Expand All @@ -107,9 +109,12 @@ Standard radio buttons are the default style for radio buttons. They are optimal
<sp-field-label for="example-2" size="l">
<h4 class="spectrum-Heading--subtitle1">Invalid</h4>
</sp-field-label>
<sp-radio-group id="example-2" name="example" vertical>
<sp-radio-group invalid id="example-2" name="example" vertical>
<sp-radio invalid value="kittens">Kittens</sp-radio>
<sp-radio invalid value="puppies" checked>Puppies</sp-radio>
<sp-help-text slot="negative-help-text" icon>
This selection is invalid.
</sp-help-text>
</sp-radio-group>
</div>

Expand All @@ -129,6 +134,8 @@ Standard radio buttons are the default style for radio buttons. They are optimal

Emphasized radio buttons are a secondary style for radio buttons. The blue color provides a visual prominence that is optimal for forms, settings, etc. where the radio buttons need to be noticed.

Invalid selections in radio groups are identified using the `negative-help-text` slot. Read more about using [help text](#help-text) below.

```html-live
<div style="display: flex; justify-content: space-between;">
<div style="display: flex; flex-direction: column;">
Expand All @@ -145,9 +152,12 @@ Emphasized radio buttons are a secondary style for radio buttons. The blue color
<sp-field-label for="example-b" size="l">
<h4 class="spectrum-Heading--subtitle1">Invalid</h4>
</sp-field-label>
<sp-radio-group id="example-b" name="example" vertical>
<sp-radio-group invalid id="example-b" name="example" vertical>
<sp-radio emphasized invalid value="kittens">Kittens</sp-radio>
<sp-radio emphasized invalid value="puppies" checked>Puppies</sp-radio>
<sp-help-text slot="negative-help-text" icon>
This selection is invalid.
</sp-help-text>
</sp-radio-group>
</div>

Expand Down