6

Semantic UI React Checkbox can be used like this:

import React from 'react'
import { Checkbox } from 'semantic-ui-react'

const TermsOfServiceCheckbox = () => (
  <Checkbox label='I accept the Terms of Service' />
)

export default TermsOfServiceCheckbox

How do I set the Checkbox label so that the text Terms of Service is a link to a URL?

user2962393
  • 852
  • 8
  • 11

1 Answers1

9

label prop implements the item shorthand, so you can also pass there:

<Checkbox label={<label><a href='/'>I accept the Terms of Service</a></label>} />
<Checkbox label={<label>I accept the <a href='/'>Terms of Service</a></label>} />
<Checkbox label={{ children: <a href='/'>I accept the Terms of Service</a> }} />
Oleksandr Fediashov
  • 3,967
  • 1
  • 20
  • 40