gcanti / tcomb-form

Forms library for react
https://gcanti.github.io/tcomb-form
MIT License
1.16k stars 136 forks source link

The t form does not style with the bootstrap styles. #384

Closed elimau closed 7 years ago

elimau commented 7 years ago

Version

Expected behaviour

When I create a t form react component, it should have the bootstrap styling. e.g. the button should have the primary colours etc.

Actual behaviour

none of the styling comes through.

Steps to reproduce

  1. Here is my App.js
    
    import React, { Component } from 'react';
    import t from 'tcomb-form';

const Form = t.form.Form;

// define your domain model with tcomb // https://github.com/gcanti/tcomb const Person = t.struct({ name: t.String, surname: t.String });

class App extends Component {

save() { // call getValue() to get the values of the form var value = this.refs.form.getValue(); // if validation fails, value will be null if (value) { // value here is an instance of Person console.log(value); } }

render() { return (

);

} }

export default App;

gcanti commented 7 years ago

The UI is completely unstyled? Did you include the bootstrap css in your page?

elimau commented 7 years ago

Thanks. I added the css to my app and it worked. Sorry, i didnt know that. Is that in the documentation? Do I need to also include the bootstrap js? I added bootstrap 3 css. You are using bootstrap 3 right? Any plans to move to bootstrap 4 or other any other theme/ui kit? Thanks alot.

gcanti commented 7 years ago

Do I need to also include the bootstrap js?

No, only the css is required

Any plans to move to bootstrap 4 or other any other theme/ui kit?

There are semantic ui templates https://github.com/gcanti/tcomb-form-templates-semantic.

Adding a theme means to write a bunch of templates, the engine (this library) should stay the same