bdc-components
v0.4.1
Published
React components for visualizing and collecting data.
Downloads
8
Readme
bdc-components
React components for visualizing and collecting data.
Install
npm install --save bdc-componentsUsage
<ThemeProvider theme={bdcTheme}>
/* { ... } */
</ThemeProvider>
<FormModal
name="Sign Up"
fieldStructures={{
name: { type: 'text' },
dob: { type: 'date' },
food: {
type: 'option',
options: [ 'pizza', 'salad', 'cookies', 'macaroni', 'chicken' ]
},
headshot: { type: 'file' },
bio: { type: 'text', multiline: true }
}}
onSubmit={console.log}
onClose={() => console.log('close')}
/>
<DataTable
fieldMap={{
email: { label: 'Email', columnTemplate: 2 },
name: { label: 'Name', columnTemplate: 2 },
role: { label: 'Role' }
}}
identifyingField="name"
items={{ jason: { email: '[email protected]', name: 'Jason', role: 'Admin' } }}
itemIcon={<UserIcon />}
itemClickHandler={userData => setUser(userData)}
/>
<Button action={() => setUser(newUser)}>
/* Icon or Text */
</Button>License
MIT © baldwin-design-co
