Soracom

Design System
  1. Home
  2. Design system
  3. Elements
  4. Radio

Radio

Options

Basic usage

html
Copy

Using <div> elements

As an alternative to using a <label> html element as the container - you may also use a <div>, with the <label> element inside it. The previous examples are the preferred structure for semantic reasons, but they will work with the syntax shown below.

html
Copy

Visual states

Default style

html
Copy

Panel style

html
Copy

Colors

html
Copy
html
Copy

Icons

Add an additional class such as --icon-online from the available icon modifier list.

html
Copy

Size

Small, medium, large

Default style

html
Copy

Panel style

html
Copy

Hiding the label

By default a checkbox shows the label text (the contents inside the div). This can be hidden using the --hide-label option. For accessibility purposes it’s preferable to have a descriptive label hidden using this method, rather than omitting the label text.

html
Copy

Styles

Custom styles exist for specific use cases.

Dots

html
Copy

Panel

Default

The default panel style will highlight the panel when selected.

The example below uses 2 ds-radio components

html
Copy

The example below uses 2 label and radio elements inside a single panel

html
Copy
Simple

Panel simple does not use a border or background highlight color when selected.

The example below uses 2 ds-radio components

html
Copy

The example below uses 2 label and radio elements inside a single panel

html
Copy

Swatches

Swatches is a style used to select color options.

The example below uses 2 radio components

html
Copy

Square

html
Copy

Tags

This option is available using ds-tags which has additional features.

Tests

Default style variations

Default style with multiple options and additional content

The example below uses 2 label and radio elements inside a single panel

html
Copy

Default style with ds-cols content

html
Copy

Panel style variations

Panel style with multiple options

The example below uses 2 label and radio elements inside a single panel

html
Copy

Panel style with multiple options and additional content

The example below uses 2 label and radio elements inside a single panel

html
Copy

Panel style with horizontal layout

To have a horizontal set of panels, place them inside a .ds-cols container.

The example below uses 2 radio components

html
Copy

Panel style with longer mixed content

The example below uses 2 radio components

html
Copy

Panel style with complex layout and content

html
Copy

Panel style with ds-cols content

html
Copy