logo

eola Style Guide 2026: Radio Button

Radio Button

RadioButton - it looks like a button but works like and can be used in situations where only one option can be chosen

DateTimeRadioGroup - used specifically for selecting a time and date from a list as part of a Formik form.

Examples

Simple Radio Button

<Formik initialValues={{radio: ""}} onSubmit={()=>{}}> 
 <Grid gridGap={2} width={20}>
  <RadioButton   
    inputId='btn'
    value='inputId'
    name='radio'
    selected={true}
  />
 </Grid>
</Formik>

Radio Button Group

<Formik initialValues={{ radioOne: "One" }}>
  <Form>
    <RadioButton
    value="One"
    name='radioOne'
    label="One" />

    <RadioButton
    value="Two"
    name='radioOne'
    label="Two"
    />
  </Form>  
</Formik>

Content Radio

<Formik initialValues={{option1: ""}} onSubmit={()=>{}}>
<Grid gridGap={2} width={200}>
  <ContentRadio name="option1" value='Yes'>
    <Text>Yes</Text>
  </ContentRadio>
 </Grid> 
</Formik>

Content Radio Group

<Formik initialValues={{ optionOne: "" }}>
  <Grid gridGap={2} width={200}>
    <ContentRadio name="optionOne" value='Yes'>
      <Text>Yes</Text>
    </ContentRadio>
    <ContentRadio name="optionOne" value='No'>
      <Text>No</Text>
    </ContentRadio>
    <ContentRadio name="optionOne" value='Maybe'>
      <Text>Maybe</Text>
    </ContentRadio>
    
  </Grid>
</Formik>
    

Time Slot

<Formik initialValues={{ timeSlotOption: "" }}>
  <Grid gridGap={2} width={400}>

    Activity
    <TimeSlot name="timeSlotOption" value="activity">
      <TimeSlotContent>
        <TimeSlotTag content={['09:00', '-', '10:30']} />
      </TimeSlotContent>
      <TimeSlotContent>
        <Text fontStyle="p2">Available</Text>
      </TimeSlotContent>
    </TimeSlot>
    
    <br />
    Rental
    <TimeSlot name="timeSlotOption" value="rental">
      <TimeSlotContent>
        <Text fontStyle="p2">09:00-09:30</Text>
        <TimeSlotTag content={['Monthly']} />
      </TimeSlotContent>
      <Divider position="vertical" />
      <TimeSlotContent>
        <Price pence={4500} currency="gbp" fontStyle="h4" />
      </TimeSlotContent>
    </TimeSlot>

     <br />
     Membership
    <TimeSlot name="timeSlotOption" value="membership">
      <TimeSlotContent>
        <TimeSlotTag content={['Monthly']} />
      </TimeSlotContent>
      <TimeSlotContent>
        <Text fontStyle="p3">Club Membership (5 Athletes)</Text>
      </TimeSlotContent>
      <TimeSlotContent>
        <Price pence={4500} currency="gbp" fontStyle="h5" />
      </TimeSlotContent>
    </TimeSlot>
    
    <br />


    Membership (disabled)
    <TimeSlot name="timeSlotOption" value="membership" disabled>
      <TimeSlotContent>
        <TimeSlotTag content={['Monthly']} />
      </TimeSlotContent>
      <TimeSlotContent>
        <Text fontStyle="p2">Available</Text>
      </TimeSlotContent>
    </TimeSlot>
  </Grid>
</Formik>
    

Sold Out Time Slot

<Grid gridGap={2} width={400}>

  Sold out
  <SoldOutTimeSlot time="12:00 - 13:00" />

  <br />
  Run of sold-out times (collapsed)
  <SoldOutTimeSlotRun
    from="12:00"
    to="15:00"
    times={[
      { id: '1', time: '12:00 - 12:30' },
      { id: '2', time: '12:45 - 13:15' },
      { id: '3', time: '13:30 - 14:00' },
      { id: '4', time: '14:15 - 14:45' },
      { id: '5', time: '15:00 - 15:30' }
    ]}
  />

  <br />
  Run of sold-out times (expanded)
  <div>
    <SoldOutTimeSlotRun
      from="12:00"
      to="15:00"
      times={[
        { id: '1', time: '12:00 - 12:30' },
        { id: '2', time: '12:45 - 13:15' },
        { id: '3', time: '13:30 - 14:00' },
        { id: '4', time: '14:15 - 14:45' },
        { id: '5', time: '15:00 - 15:30' }
      ]}
      defaultExpanded
    />
  </div>
</Grid>
    

Time List With Sold Out Times

<Formik initialValues={{ timeSlotOption: "" }}>
  <Grid width={400}>
    <TimeSlot name="timeSlotOption" value="09:00">
      <TimeSlotContent>
        <TimeSlotTag content={['09:00 - 10:00']} />
      </TimeSlotContent>
      <TimeSlotContent>
        <Text fontStyle="p2">Available</Text>
      </TimeSlotContent>
    </TimeSlot>
    <SoldOutTimeSlot time="10:15 - 11:15" />
    <TimeSlot name="timeSlotOption" value="11:30">
      <TimeSlotContent>
        <TimeSlotTag content={['11:30 - 12:30']} />
      </TimeSlotContent>
      <TimeSlotContent>
        <Text size="md" weight={600}>
          Nearly full
        </Text>
      </TimeSlotContent>
    </TimeSlot>
    <SoldOutTimeSlotRun
      from="12:45"
      to="15:45"
      times={[
        { id: '1', time: '12:45 - 13:45' },
        { id: '2', time: '13:45 - 14:45' },
        { id: '3', time: '14:45 - 15:45' },
        { id: '4', time: '15:45 - 16:45' }
      ]}
    />
    <TimeSlot name="timeSlotOption" value="17:00" disabled>
      <TimeSlotContent>
        <TimeSlotTag content={['17:00 - 18:00']} />
      </TimeSlotContent>
      <TimeSlotContent>
        <Text fontStyle="p2">Too few spaces</Text>
      </TimeSlotContent>
    </TimeSlot>
  </Grid>
</Formik>