---
updatedAt: 2026-02-26T13:11:41.000Z
agentTools:
  projectIndex: https://docs.ksa.ngenius-payments.com/llms.txt
---

# Display payment request fields above the text box

By default, the N-genius Hosted Session SDK displays labels *inside* the card input fields as placeholders. While this keeps the layout compact, some merchants may prefer labels to appear **above** each field for accessibility or visual clarity.

This guide shows you how to enable **floating labels above the card input fields** using a single style flag.

***

### Before (Default SDK Layout)

The default Hosted Session fields display placeholder text inside the input boxes, like:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/8ec6d0e34dfa929e33b640e8cb92f50adaba9a5e830c2b64b13f12858b362c06-payment-details-no-labels.png",
        "",
        "The screenshot displays the placeholder text inside the text boxes. "
      ],
      "align": "center",
      "caption": "Placeholder Text Inside"
    }
  ]
}
[/block]

***

### After (With Labels Above)

When the `showInputsLabel` flag is set to `true`, labels are shown **above** each input box instead:

[block:image]
{
  "images": [
    {
      "image": [
        "https://files.readme.io/5b81b0da98bd91547f50e4c84b5c666cc09d72bd218557106074bef48280918c-payment-details-with-labels.png",
        "",
        "The screenshot displays the placeholder text above the text boxes, after the changes have been applied to the hosted session sdk."
      ],
      "align": "center",
      "caption": "Placeholder Text Above"
    }
  ]
}
[/block]

***

### How to Enable Labels Above Inputs

To switch to this layout, simply add the `showInputsLabel: true` flag inside the `style` object when calling `mountCardInput`.

```javascript
const style = {
  main: {},     // Style for wrapper div
  base: {},     // Base styles
  input: {},    // Input field styling
  invalid: {},  // Invalid state styling

  // NEW: Show labels above the input fields
  showInputsLabel: true
};

window.NI.mountCardInput('mount-id', {
  apiKey: 'HOSTED_SESSION_API_KEY',
  outletRef: 'YOUR_OUTLET_REFERENCE',
  style,
  language: 'en',
  firstName: '<firstname>',
  lastName: '<lastname>',
  onSuccess: () => console.log('Mounted successfully'),
  onFail: (err) => console.error('Failed to mount', err),
});
```

<br />

### Notes

* `showInputsLabel` is **optional**.
* The **default is `false`**, which preserves the original placeholder-based layout.
* Setting it to `true` enables the enhanced, label-above style.

***

### Final Tip

Test your layout across devices — some merchants find the labeled layout more readable on mobile, while others prefer the minimal placeholder style for space efficiency.