Skip to content
Tim Brayshaw edited this page Jan 15, 2016 · 1 revision

It is possible to add or remove CSS class names on the markup generated for the enclosing row, label, and element wrapper.

Class names are added or removed using the "deduped" version of JedWatson/classnames.

<Input
  name="cssRowTweak"
  id="example"
  type="text"
  rowClassName="yellow"
  labelClassName={[{'col-sm-3': false}, 'col-sm-5']}
  elementWrapperClassName={[{'col-sm-9': false}, 'col-sm-7']}
/>

The output for the example above becomes:

<div class="form-group row yellow">
  <label class="control-label col-sm-5" for="example">This row is yellow</label>
  <div class="col-sm-7">
    <input class="form-control" name="cssRowTweak" value="" type="text" id="example">
  </div>
</div>

See the Layout tweaks in the playground for an example (code).

Clone this wiki locally