-
Notifications
You must be signed in to change notification settings - Fork 2
How to add text label for checkbox #6
Comments
Hi! Checkbox itself is a standalone component, so you have to wrap in HTML import FieldGroup from '#field-group';
import Checkbox from '#checkbox';
//
FieldGroup(
{
label: 'label text'
// labelPosition: 'left'
},
Checkbox({ checked: true })
);
// |
And how to add |
Label in demo is broken. Can you update demo? |
There is no need for Checkbox({ checked: true, id: 'my-id' })
Oops. |
@vitaliyzolotoy there was a misunderstanding — if you want to trigger checkbox by clicking on its label you should wrap it into import Label from '#label';
import Input from '#input';
// ...
Label({ text: 'click me to trigger checkbox' },
Input({ type: 'checkbox' })
)
// ...
could you please point out on what is broken exactly? |
No one of above examples works for me. I just want to add |
@vitaliyzolotoy could you please provide some example of code or a repo — it's really hard to understand what exactly means “nothing works” |
@mistadikay Please, check examples in https://github.com/rebem/core-components/blob/master/demo/components/demo/index.js |
@vitaliyzolotoy here is the screenshot with a rendered label from demo: If something is not working for you, please provide expected/actual results and steps to reproduce. Also any information about your OS/environment would be helpful. Thanks |
@mistadikay Thank you |
Hello!
How I can add
checkbox__text
label to checkbox?Checkbox({ mods: { size: 'xl' } }, 'Yes, I agree to the')
The text was updated successfully, but these errors were encountered: