question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to omit all field labels

See original GitHub issue

Is there an option to omit field labels for all form fields, or do I need to add ‘ui:options’: { label: false } to each property?

I’m looking for an option like this:

const uiSchema = {
  'ui:label': false,
};

Right now I have,

const schema = {
  title: 'My Form',
  type: 'object',
  properties: {
    firstName: { type: 'string', title: 'First Name' },
    lastName: { type: 'string', title: 'Last Name' },
    email: { type: 'string', title: 'Email' },
  },
};

const uiSchema = {
  'ui:readonly': true,
  firstName: {
    'ui:options': {
      label: false,
    },
  },
  lastName: {
    'ui:options': {
      label: false,
    },
  },
  email: {
    'ui:options': {
      inputType: 'email',
      label: false,
    },
  },
};

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
glasserccommented, Jan 23, 2019

I think there’s been a few different times when users wished they could do certain kinds of programmatic traversal of a JSON Schema and either alter it, or produce a UI Schema from it. It would be really cool to see some kind of function, class or module that let you say “Here is a schema and some rules about what to do with the schema” and took care of the recursion.

This isn’t a real API but maybe this will communicate the idea better:

let uiSchema = traverseSchema(schema, {
  onProperty: function(currentPath, schema) {
    if (schema.type === "string") {
      return { "ui:options": { label: false } };
    }
  }
});
0reactions
epicfaacecommented, Jun 23, 2020

Is there an option to omit field labels for all form fields

You could also use CSS!

legend {
    display: none;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Hide Field Labels on a Form - Jotform
Click the gear icon to open the form element's properties panel. · Go to the Advanced tab. · Scroll down and expand the...
Read more >
An Option To Hide Field Labels In Knowledge Articles In A ...
I would like to have an option to hide field labels on knowledge articles in a Community, especially since you can't remove the...
Read more >
Jira field label values removal - Atlassian Community
To completely remove a label you must find and remove every occurrence from all issues. You can use bulk edit to find and...
Read more >
How to remove the field label completely - Marketing Nation
I have a form where I have deleted all of the field labels and instead, have included them in the hint text. When...
Read more >
Possible to SELECTIVELY hide field label(s)?
Currently, we could use Analysis -> Table Layout -> Show Field Labels for Rows/Columns to show/hide field labels, and this action applies to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found