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
  • 1,083
  • 9
  • 12

1 Answers1

11

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
  • 4,315
  • 1
  • 24
  • 42