bloomer icon indicating copy to clipboard operation
bloomer copied to clipboard

Make it more modular

Open Vortelf opened this issue 7 years ago • 2 comments

Hello, I really like bulma and this is really nice soluton to using it with React, but... Including every component on it's own just so you can use it make some pretty long inports:

import { Field as Bfield, Form, Input, Group, Label, Control, Checkbox, Textarea, Select } from 'bloomer'

Instead why don't you make it modular, so it can be simplier like this

import { Form } from 'bloomer'
...
<Form>
  <Form.Field>
    <Form.Input />
  </Form.Field>
<Form>

This goes for Form, Nav, Navbar, Columns, Hero, Cards and basically everything.

Here's a pseudo example on Forms and how it could be done:

...
import FormCheckbox from './Form/Checkbox'
import FormField from './Form/Field/Field'
import FormInput from './Form/Input'
import FormLabel from './Form/Label'
import FormRadio from './Form/Radio'
import FormSelect from './Form/Select'
import FormTextArea from './Form/TextArea'
....
class Form extends Component {
 ...
  static Field = FormField
  static Checkbox = FormCheckbox
  static Input = FormInput
  static Radio = FormRadio
  static Select = FormSelect
  static TextArea = FormTextArea
  static Label = FormLabel
  ....
}

Vortelf avatar Nov 14 '17 11:11 Vortelf

Can you give a description? Maybe an example?

Thanks.

AlgusDark avatar Nov 14 '17 13:11 AlgusDark

Best example I could give you is Semantic-UI-React.

Vortelf avatar Nov 14 '17 15:11 Vortelf