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
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
10. “
Front-end development at Autopilot is the
process of building sophisticated user
interfaces consisting of thousands of
small, focused, testable and composable
components.