Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checkbox label with URL link in Semantic UI React

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?

like image 669
user2962393 Avatar asked Aug 31 '17 23:08

user2962393


1 Answers

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> }} />
like image 168
Oleksandr Fediashov Avatar answered Oct 22 '22 22:10

Oleksandr Fediashov