lyra/embedded-form-glue

Field label SPA

Closed this issue · 3 comments

I can't add a label to my fields in a SPA App using React.
is there any method to custom labels?

Hi @alaaomri ,

You can update the labels with setFormConfig method.

await KR.setFormConfig({
  'kr-label-pan': 'my pan label', 
  'kr-label-expiry': 'my exp label', 
  'kr-label-security-code': 'my cvv label'
})

Here you can find the available parameters reference.

Hi @s-yagues,
Thank you for the response.
This is my object config s KR.setFormConfig({
formToken: token,
spaMode: true,
"kr-placeholder-pan": "16 chiffres",
"kr-placeholder-expiry": "MM/AA",
"kr-placeholder-security-code": "3 chiffres",
'kr-label-pan': 'Num carte',
'kr-label-expiry': 'date expiration',
'kr-label-security-code': 'CVV',
}) and is not applicable.
I have the placeholder shown but not the labels
Is there any method to use them both ?

Unfortunately, for now the labels are only enabled if you use the material theme. By default, they remain disabled.

You can use it by following this guide.

We are working on making label visibility configurable.