Radio Svelte Component

Radio Svelte component represents Radio component.

Radio Components

There are following components included:

  • Radio

Radio Properties

PropTypeDefaultDescription
<Radio> properties
checkedbooleanDefines whether the radio input is checked or not
namestring
number
Radio input name
valuestring
number
boolean
Radio input value
disabledbooleanDefines whether the radio input is disabled
readonlybooleanDefines whether the radio input is readonly

Radio Events

EventDescription
<Radio> events
changeEvent will be triggered when radio input state changed

Radios List

Radios List is not a separate component, but just a particular case of using <List>, <ListItem>.

<List>
  <!-- Additional "radio" prop to enable radio list item -->
  <ListItem radio value="check_1" name="demo-radio" checked title="Radio 1" />
  <ListItem radio value="check_2" name="demo-radio" title="Radio 2" />
</List>

Examples

<Page>
  <Navbar title="Radio"></Navbar>

  <BlockTitle>Inline</BlockTitle>
  <Block strong>
    <p>Lorem <Radio name="demo-radio-inline" value="inline-1"/> ipsum dolor sit amet, consectetur adipisicing elit. Alias beatae illo nihil aut eius commodi sint eveniet aliquid eligendi <Radio name="demo-radio-inline" value="inline-2" checked /> ad delectus impedit tempore nemo, enim vel praesentium consequatur nulla mollitia!</p>
  </Block>

  <BlockTitle>Radio Group</BlockTitle>
  <BlockHeader>Icon in the beginning of the list item</BlockHeader>
  <List>
    <ListItem
      radio
      radioIcon="start"
      title="Books"
      value="Books"
      name="demo-radio-start"
      checked
    ></ListItem>
    <ListItem
      radio
      radioIcon="start"
      title="Movies"
      value="Movies"
      name="demo-radio-start"
    ></ListItem>
    <ListItem
      radio
      radioIcon="start"
      title="Food"
      value="Food"
      name="demo-radio-start"
    ></ListItem>
    <ListItem
      radio
      radioIcon="start"
      title="Drinks"
      value="Drinks"
      name="demo-radio-start"
    ></ListItem>
  </List>

  <BlockHeader>Icon in the end of the list item</BlockHeader>
  <List>
    <ListItem
      radio
      radioIcon="end"
      title="Books"
      value="Books"
      name="demo-radio-end"
      checked
    ></ListItem>
    <ListItem
      radio
      radioIcon="end"
      title="Movies"
      value="Movies"
      name="demo-radio-end"
    ></ListItem>
    <ListItem
      radio
      radioIcon="end"
      title="Food"
      value="Food"
      name="demo-radio-end"
    ></ListItem>
    <ListItem
      radio
      radioIcon="end"
      title="Drinks"
      value="Drinks"
      name="demo-radio-end"
    ></ListItem>
  </List>

  <BlockTitle>With Media Lists</BlockTitle>
  <List mediaList>
    <ListItem
      radio
      checked
      name="demo-media-radio"
      value="1"
      title="Facebook"
      after="17:14"
      subtitle="New messages from John Doe"
      text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
    ></ListItem>
    <ListItem
      radio
      name="demo-media-radio"
      value="2"
      title="John Doe (via Twitter)"
      after="17:11"
      subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
      text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
    ></ListItem>
    <ListItem
      radio
      name="demo-media-radio"
      value="3"
      title="Facebook"
      after="16:48"
      subtitle="New messages from John Doe"
      text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
    ></ListItem>
    <ListItem
      radio
      name="demo-media-radio"
      value="4"
      title="John Doe (via Twitter)"
      after="15:32"
      subtitle="John Doe (@_johndoe) mentioned you on Twitter!"
      text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."
    ></ListItem>
  </List>
</Page>
  


<script>
  import {Page, Navbar, BlockTitle, BlockHeader, Block, Radio, List, ListItem} from 'framework7-svelte';
</script>