SlideShare a Scribd company logo
1 of 33
Download to read offline
A simple <button />
It’s a composable UI component
<button onClick={callMeOnClick}>Click Me!</button>
Composition, Good old days
<button class=”btn btn--tarmac btn--large”>
Click Me!
</button>
<Button />
An enhanced <button /> component
<Button text="Click Me!" color="tarmac" />
◉ Uses the <button /> under the hood
◉ Enhances the <button /> via “color” field
<Button /> with icon
<Button /> version 1.1
<Button color="yellow" icon="edit" text="Edit" />
◉ Uses the <Icon /> under the hood
◉ Configure the icon via “icon” field
<Button /> with colored icon
<Button /> version 1.2
<Button color="yellow" icon="edit"
iconColor="black" text="Edit" />
◉ Icon color via the “iconColor” field
That’s Exactly What
We Should Not Do
!
Why not to do?
◉ Lack of composition via consumer developer
◉ Lack of separation of concerns
◉ Code duplication
◉ Maintenance overhead
◉ Test overhead
What I Talk About
When I Talk About Composition
I am Mehdi
Software Engineer at Autopilot
@mehdivk
hi@mv.id.au
Hello!
“
Front-end development at Autopilot is the
process of building sophisticated user
interfaces consisting of thousands of
small, focused, testable and composable
components.
<Button />, revised
To compose <Icon />
<Button>
<Icon size="small" color="black" symbol="edit" />
Edit
</Button>
What composition actually offers?
◉ Maximum flexibility
◉ Minimum coupling
◉ Maintainable components
◉ Testable components
Showcase Time
<Modal />
<Modal />
<Modal size={modalSize} type={modalType}>
<ModalHeader></ModalHeader>
<ModalContent></ModalContent>
<ModalFooter></ModalFooter>
<ModalClose></ModalClose>
</Modal>
<Modal />
Overlays the other elements on page
<Modal />
<Position xAxis="center" yAxis="center">
<Overlay>
<Modal>
<ModalHeader />
<ModalContent />
<ModalFooter />
</Modal>
</Overlay>
</Position>
Overlays the other elements on page
<FolderExplorer />
<FolderExplorer />
<Position anchor="someElement">
<FolderExplorer />
</Position>
<ContextMenu />
<ContextMenu />
<Position anchor="someElement">
<DropDownMenu>
<DropDownMenuOption icon="edit" onClick={onEditClick}>Edit</DropDownMenuOption>
<DropDownMenuOption icon="trash" onClick={onTrash}>Trash</DropDownMenuOption>
<DropDownMenuOption icon="folder" disabled>Move to folder</DropDownMenuOption>
</DropDownMenu>
</Position>
<ContextMenu />
Forms
Forms
<Form labelOn="top" size="large" ref={this.setFormReference}>
<Element id="goalName">
<Label text="Goal name" />
<TextBox placeholder="Type what people become who complete the goal, e.g. customer" />
<Validator>
<Required />
</Validator>
</Element>
<Elements>
<Label text="Conversion target" />
<Element id="conversionTarget" className="goal-form__conversion-target">
<TextBox placeholder="10" />
<Validator>
<Required />
{ this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null }
</Validator>
</Element>
<Element id="conversionTargetType">
<ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} />
<Validator>
<Required />
</Validator>
</Element>
</Elements>
</Form>
Forms
<Form labelOn="top" size="large" ref={this.setFormReference}>
<Element id="goalName">
<Label text="Goal name" />
<TextBox placeholder="Type what people become who complete the goal, e.g. customer" />
<Validator>
<Required />
</Validator>
</Element>
<Elements>
<Label text="Conversion target" />
<Element id="conversionTarget" className="goal-form__conversion-target">
<TextBox placeholder="10" />
<Validator>
<Required />
{ this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null }
</Validator>
</Element>
<Element id="conversionTargetType">
<ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} />
<Validator>
<Required />
</Validator>
</Element>
</Elements>
</Form>
Forms
<Form labelOn="top" size="large" ref={this.setFormReference}>
<Element id="goalName">
<Label text="Goal name" />
<TextBox placeholder="Type what people become who complete the goal, e.g. customer" />
<Validator>
<Required />
</Validator>
</Element>
<Elements>
<Label text="Conversion target" />
<Element id="conversionTarget" className="goal-form__conversion-target">
<TextBox placeholder="10" />
<Validator>
<Required />
{ this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null }
</Validator>
</Element>
<Element id="conversionTargetType">
<ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} />
<Validator>
<Required />
</Validator>
</Element>
</Elements>
</Form>
Forms
<Form labelOn="top" size="large" ref={this.setFormReference}>
<Element id="goalName">
<Label text="Goal name" />
<TextBox placeholder="Type what people become who complete the goal, e.g. customer" />
<Validator>
<Required />
</Validator>
</Element>
<Elements>
<Label text="Conversion target" />
<Element id="conversionTarget" className="goal-form__conversion-target">
<TextBox placeholder="10" />
<Validator>
<Required />
{ this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null }
</Validator>
</Element>
<Element id="conversionTargetType">
<ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} />
<Validator>
<Required />
</Validator>
</Element>
</Elements>
</Form>
Forms
<Form labelOn="top" size="large" ref={this.setFormReference}>
<Element id="goalName">
<Label text="Goal name" />
<TextBox placeholder="Type what people become who complete the goal, e.g. customer" />
<Validator>
<Required />
</Validator>
</Element>
<Elements>
<Label text="Conversion target" />
<Element id="conversionTarget" className="goal-form__conversion-target">
<TextBox placeholder="10" />
<Validator>
<Required />
{ this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null }
</Validator>
</Element>
<Element id="conversionTargetType">
<ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} />
<Validator>
<Required />
</Validator>
</Element>
</Elements>
</Form>
Forms
this.goalForm.validate();
this.goalForm.isValid();
this.goalForm.value();
this.goalForm.value('conversionTarget');
Forms
<Table />
<Table />
<Table dataSource={this.props.assets} className="asset-manager__table">
<TableCell header="Status">
<TableRowStatus field="status" valueToColorMap={valueToColorMap} />
</TableCell>
<TableCell header="Name">
<TableCellValue field="name" />
</TableCell>
<TableCell header="In Journeys">
<TableCellValue field="inJourneys" />
</TableCell>
<TableCell header="Type">
<TableCellValue format="camel-case" field="type" />
</TableCell>
<TableCell header="Created By">
<TableCellValue field="createdBy" />
</TableCell>
<TableCell header="Edited">
<TableCellValue format="date" field="edited" />
</TableCell>
<TableCell header="Published">
<TableCellValue format="date" field="published" />
</TableCell>
</Table>
Any questions ?
You can find me at
◉ @mehdivk
◉ hi@mv.id.au
Thanks!

More Related Content

Similar to What I Talk About When I Talk About Composition

jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )EZoApp
 
HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4Sanjeev Kumar
 
A comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentA comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentKaty Slemon
 
Chapter 2 class power point
Chapter 2 class power pointChapter 2 class power point
Chapter 2 class power pointcmurphysvhs
 
05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & Animation05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & AnimationNguyen Tuan
 
How to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento ExtensionHow to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento ExtensionHendy Irawan
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html formsCK Yang
 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html formsCK Yang
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with AngularAna Cidre
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireAndreas Nedbal
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerNuzhat Memon
 
Scope proposal-ecommerce-website
Scope proposal-ecommerce-websiteScope proposal-ecommerce-website
Scope proposal-ecommerce-websitemaxtra
 
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.154.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15Rajes Wari
 

Similar to What I Talk About When I Talk About Composition (20)

WPF - An introduction
WPF - An introductionWPF - An introduction
WPF - An introduction
 
Unit2
Unit2Unit2
Unit2
 
jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )jQuery Mobile Introduction ( demo on EZoapp )
jQuery Mobile Introduction ( demo on EZoapp )
 
HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4HTML 5 Simple Tutorial Part 4
HTML 5 Simple Tutorial Part 4
 
A comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter componentA comprehensive guide on developing responsive and common react filter component
A comprehensive guide on developing responsive and common react filter component
 
Chapter 2 class power point
Chapter 2 class power pointChapter 2 class power point
Chapter 2 class power point
 
05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & Animation05.Blend Expression, Transformation & Animation
05.Blend Expression, Transformation & Animation
 
How to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento ExtensionHow to Create A Magento Adminhtml Controller in Magento Extension
How to Create A Magento Adminhtml Controller in Magento Extension
 
Html forms
Html formsHtml forms
Html forms
 
Lecture-5.pptx
Lecture-5.pptxLecture-5.pptx
Lecture-5.pptx
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html forms
 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html forms
 
Web components with Angular
Web components with AngularWeb components with Angular
Web components with Angular
 
HTML FORMS.pptx
HTML FORMS.pptxHTML FORMS.pptx
HTML FORMS.pptx
 
Html form
Html formHtml form
Html form
 
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the WireUn-Framework - Delivering Dynamic Experiences with HTML over the Wire
Un-Framework - Delivering Dynamic Experiences with HTML over the Wire
 
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZerStd 12 Computer Chapter 1 Creating Html Forms Using KompoZer
Std 12 Computer Chapter 1 Creating Html Forms Using KompoZer
 
Chapter 02
Chapter 02Chapter 02
Chapter 02
 
Scope proposal-ecommerce-website
Scope proposal-ecommerce-websiteScope proposal-ecommerce-website
Scope proposal-ecommerce-website
 
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.154.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
4.7.14&amp;17.7.14&amp;23.6.15&amp;10.9.15
 

Recently uploaded

signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsapna80328
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming languageSmritiSharma901052
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfBalamuruganV28
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Erbil Polytechnic University
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfManish Kumar
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptJohnWilliam111370
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptxmohitesoham12
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solidnamansinghjarodiya
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书rnrncn29
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosVictor Morales
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdfHafizMudaserAhmad
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTSneha Padhiar
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsResearcher Researcher
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxStephen Sitton
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating SystemRashmi Bhat
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdfAkritiPradhan2
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Coursebim.edu.pl
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfChristianCDAM
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfalene1
 

Recently uploaded (20)

signals in triangulation .. ...Surveying
signals in triangulation .. ...Surveyingsignals in triangulation .. ...Surveying
signals in triangulation .. ...Surveying
 
OOP concepts -in-Python programming language
OOP concepts -in-Python programming languageOOP concepts -in-Python programming language
OOP concepts -in-Python programming language
 
CS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdfCS 3251 Programming in c all unit notes pdf
CS 3251 Programming in c all unit notes pdf
 
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
Comparative study of High-rise Building Using ETABS,SAP200 and SAFE., SAFE an...
 
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdfModule-1-(Building Acoustics) Noise Control (Unit-3). pdf
Module-1-(Building Acoustics) Noise Control (Unit-3). pdf
 
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.pptROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
ROBOETHICS-CCS345 ETHICS AND ARTIFICIAL INTELLIGENCE.ppt
 
Python Programming for basic beginners.pptx
Python Programming for basic beginners.pptxPython Programming for basic beginners.pptx
Python Programming for basic beginners.pptx
 
Engineering Drawing section of solid
Engineering Drawing     section of solidEngineering Drawing     section of solid
Engineering Drawing section of solid
 
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTAC® CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
『澳洲文凭』买麦考瑞大学毕业证书成绩单办理澳洲Macquarie文凭学位证书
 
KCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitosKCD Costa Rica 2024 - Nephio para parvulitos
KCD Costa Rica 2024 - Nephio para parvulitos
 
11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf11. Properties of Liquid Fuels in Energy Engineering.pdf
11. Properties of Liquid Fuels in Energy Engineering.pdf
 
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENTFUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
FUNCTIONAL AND NON FUNCTIONAL REQUIREMENT
 
Novel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending ActuatorsNovel 3D-Printed Soft Linear and Bending Actuators
Novel 3D-Printed Soft Linear and Bending Actuators
 
Turn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptxTurn leadership mistakes into a better future.pptx
Turn leadership mistakes into a better future.pptx
 
Input Output Management in Operating System
Input Output Management in Operating SystemInput Output Management in Operating System
Input Output Management in Operating System
 
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdfDEVICE DRIVERS AND INTERRUPTS  SERVICE MECHANISM.pdf
DEVICE DRIVERS AND INTERRUPTS SERVICE MECHANISM.pdf
 
Katarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School CourseKatarzyna Lipka-Sidor - BIM School Course
Katarzyna Lipka-Sidor - BIM School Course
 
Ch10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdfCh10-Global Supply Chain - Cadena de Suministro.pdf
Ch10-Global Supply Chain - Cadena de Suministro.pdf
 
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdfComprehensive energy systems.pdf Comprehensive energy systems.pdf
Comprehensive energy systems.pdf Comprehensive energy systems.pdf
 

What I Talk About When I Talk About Composition

  • 1. A simple <button /> It’s a composable UI component <button onClick={callMeOnClick}>Click Me!</button>
  • 2. Composition, Good old days <button class=”btn btn--tarmac btn--large”> Click Me! </button>
  • 3. <Button /> An enhanced <button /> component <Button text="Click Me!" color="tarmac" /> ◉ Uses the <button /> under the hood ◉ Enhances the <button /> via “color” field
  • 4. <Button /> with icon <Button /> version 1.1 <Button color="yellow" icon="edit" text="Edit" /> ◉ Uses the <Icon /> under the hood ◉ Configure the icon via “icon” field
  • 5. <Button /> with colored icon <Button /> version 1.2 <Button color="yellow" icon="edit" iconColor="black" text="Edit" /> ◉ Icon color via the “iconColor” field
  • 6. That’s Exactly What We Should Not Do !
  • 7. Why not to do? ◉ Lack of composition via consumer developer ◉ Lack of separation of concerns ◉ Code duplication ◉ Maintenance overhead ◉ Test overhead
  • 8. What I Talk About When I Talk About Composition
  • 9. I am Mehdi Software Engineer at Autopilot @mehdivk hi@mv.id.au Hello!
  • 10. “ Front-end development at Autopilot is the process of building sophisticated user interfaces consisting of thousands of small, focused, testable and composable components.
  • 11. <Button />, revised To compose <Icon /> <Button> <Icon size="small" color="black" symbol="edit" /> Edit </Button>
  • 12. What composition actually offers? ◉ Maximum flexibility ◉ Minimum coupling ◉ Maintainable components ◉ Testable components
  • 15. <Modal /> <Modal size={modalSize} type={modalType}> <ModalHeader></ModalHeader> <ModalContent></ModalContent> <ModalFooter></ModalFooter> <ModalClose></ModalClose> </Modal>
  • 16. <Modal /> Overlays the other elements on page
  • 17. <Modal /> <Position xAxis="center" yAxis="center"> <Overlay> <Modal> <ModalHeader /> <ModalContent /> <ModalFooter /> </Modal> </Overlay> </Position> Overlays the other elements on page
  • 21. <ContextMenu /> <Position anchor="someElement"> <DropDownMenu> <DropDownMenuOption icon="edit" onClick={onEditClick}>Edit</DropDownMenuOption> <DropDownMenuOption icon="trash" onClick={onTrash}>Trash</DropDownMenuOption> <DropDownMenuOption icon="folder" disabled>Move to folder</DropDownMenuOption> </DropDownMenu> </Position>
  • 23. Forms
  • 24. Forms <Form labelOn="top" size="large" ref={this.setFormReference}> <Element id="goalName"> <Label text="Goal name" /> <TextBox placeholder="Type what people become who complete the goal, e.g. customer" /> <Validator> <Required /> </Validator> </Element> <Elements> <Label text="Conversion target" /> <Element id="conversionTarget" className="goal-form__conversion-target"> <TextBox placeholder="10" /> <Validator> <Required /> { this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null } </Validator> </Element> <Element id="conversionTargetType"> <ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} /> <Validator> <Required /> </Validator> </Element> </Elements> </Form>
  • 25. Forms <Form labelOn="top" size="large" ref={this.setFormReference}> <Element id="goalName"> <Label text="Goal name" /> <TextBox placeholder="Type what people become who complete the goal, e.g. customer" /> <Validator> <Required /> </Validator> </Element> <Elements> <Label text="Conversion target" /> <Element id="conversionTarget" className="goal-form__conversion-target"> <TextBox placeholder="10" /> <Validator> <Required /> { this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null } </Validator> </Element> <Element id="conversionTargetType"> <ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} /> <Validator> <Required /> </Validator> </Element> </Elements> </Form>
  • 26. Forms <Form labelOn="top" size="large" ref={this.setFormReference}> <Element id="goalName"> <Label text="Goal name" /> <TextBox placeholder="Type what people become who complete the goal, e.g. customer" /> <Validator> <Required /> </Validator> </Element> <Elements> <Label text="Conversion target" /> <Element id="conversionTarget" className="goal-form__conversion-target"> <TextBox placeholder="10" /> <Validator> <Required /> { this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null } </Validator> </Element> <Element id="conversionTargetType"> <ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} /> <Validator> <Required /> </Validator> </Element> </Elements> </Form>
  • 27. Forms <Form labelOn="top" size="large" ref={this.setFormReference}> <Element id="goalName"> <Label text="Goal name" /> <TextBox placeholder="Type what people become who complete the goal, e.g. customer" /> <Validator> <Required /> </Validator> </Element> <Elements> <Label text="Conversion target" /> <Element id="conversionTarget" className="goal-form__conversion-target"> <TextBox placeholder="10" /> <Validator> <Required /> { this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null } </Validator> </Element> <Element id="conversionTargetType"> <ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} /> <Validator> <Required /> </Validator> </Element> </Elements> </Form>
  • 28. Forms <Form labelOn="top" size="large" ref={this.setFormReference}> <Element id="goalName"> <Label text="Goal name" /> <TextBox placeholder="Type what people become who complete the goal, e.g. customer" /> <Validator> <Required /> </Validator> </Element> <Elements> <Label text="Conversion target" /> <Element id="conversionTarget" className="goal-form__conversion-target"> <TextBox placeholder="10" /> <Validator> <Required /> { this.state.conversionType ? <ValidConversionTarget type={this.state.conversionType} /> : null } </Validator> </Element> <Element id="conversionTargetType"> <ComboBox placeholder="Please select" options={conversionTargetTypes} onChange={this.onConversionTypeChange} /> <Validator> <Required /> </Validator> </Element> </Elements> </Form>
  • 30. Forms
  • 32. <Table /> <Table dataSource={this.props.assets} className="asset-manager__table"> <TableCell header="Status"> <TableRowStatus field="status" valueToColorMap={valueToColorMap} /> </TableCell> <TableCell header="Name"> <TableCellValue field="name" /> </TableCell> <TableCell header="In Journeys"> <TableCellValue field="inJourneys" /> </TableCell> <TableCell header="Type"> <TableCellValue format="camel-case" field="type" /> </TableCell> <TableCell header="Created By"> <TableCellValue field="createdBy" /> </TableCell> <TableCell header="Edited"> <TableCellValue format="date" field="edited" /> </TableCell> <TableCell header="Published"> <TableCellValue format="date" field="published" /> </TableCell> </Table>
  • 33. Any questions ? You can find me at ◉ @mehdivk ◉ hi@mv.id.au Thanks!