8. Save time on creating common UI elements
Save time on learning conventions behind UI logic
9. Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
10. Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
11. Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
Help with good accessibility
12. Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
Help with good accessibility
Help with avoiding bugs
13. Save time on creating common UI elements
Save time on learning conventions behind UI logic
Save time on figuring out this conventions for every project
Save time on documenting UI components
Help with good accessibility
Help with avoiding bugs
Help with partially separating business logic from UI logic
14. So why we still build
a lot of things from
scratch?
21. Goals
What problem we are trying to solve?
Faster prototyping / Ability to reuse UI
atoms (buttons, inputs etc) / Having
common design system across all the
projects to omit a lot of groundwork
Who is gonna use this?
Everyone / Whole company / One team?
How they’’re gonna use this?
Copy whole pages and modify / Build
websites from scratch / Customize only
colors / Customize whole designs ?
22. Goals
What problem we are trying to solve?
Faster prototyping / Ability to reuse UI
atoms (buttons, inputs etc) / Having
common design system across all the
projects to omit a lot of groundwork
Who is gonna use this?
Everyone / Whole company / One team?
How they’’re gonna use this?
Copy whole pages and modify / Build
websites from scratch / Customize only
colors / Customize whole designs ?
24. Option 1
Deliver as a Vue plugin
+ Easy to understand
+ Simple installation
+ Abstraction over „installation"
process
25. Option 1
Deliver as a Vue plugin
+ Easy to understand
+ Simple installation
+ Abstraction over „installation"
process
- Limiting in customization
- Bad for performance (unless
you do a lot of hacks)
- Feels more distant from the
source code
- Abstraction over „installation"
process
Good tutorial on this by Linus borg
https://github.com/LinusBorg/talks/tree/master/2019-02-15%20Vue.js%20Amsterdam
26. Option 2
Ship „raw” source
+ Full control over imported
files
+ Great for performance
+ Better understanding of what
you’re importing
+ Direct interactions with
objects
+ No need to think about build-
time optimization and polyfills
while shipping the lib
27. Option 2
Ship „raw” source
+ Full control over imported
files
+ Great for performance
+ Better understanding of what
you’re importing
+ Direct interactions with
objects
+ No need to think about build-
time optimization and polyfills
while shipping the lib
28. Option 2
Ship „raw” source
+ Full control over imported
files
+ Great for performance
+ Better understanding of what
you’re importing
+ Direct interactions with
objects
+ No need to think about build-
time optimization and polyfills
while shipping the lib
- Requires build step on the
application level
- Requires more knowledge
about the project itself
- A bit harder to use
29. Option 2
Ship „raw” source
Use CopyPlugin to deliver
„production” raw sorce:
- Flatten files tree
- Ignore development-only
files
- Update imports
VS
33. Think in Atoms
Having reasonable amount of granular (atomic)
components ensures that library can be used in almost
any context.
Instead of providing complex components specific for
some context provide context-less granular atoms that
everyone can use in any way they want.
Start with a complex component and figure out which of
it’s parts could be reusable atoms. With each new
component you’’ have less atoms to
36. Start with a
style guide
Style guide is a great starting point
for every project.
Define a style guide with available
colors, font sizes, headings, fonts,
spacings etc.
If possible use only those values in
components.
By doing this you can easily follow
same conventions in all of your
components.
37. Start with a
style guide
Make CSS/SCSS variables from
this style guide and make them
easily overridable (for example
with SCSS !default
Refer to this variables in your
components
38. Use one
config file
Then you can make it much easier
for others to share and reuse their
configuration
40. Props
Props are great if we want to
customize component for specific
use case.
They are not so good for a very
generic components though.
Props are perfectly suitable for
tasks like filling text blocks/
attributes, providing sources for
images and icons, changing
component behavior etc.
41. Don’t overuse props!
The main problem with props is that we tend to use
them for everything even if it doesn’t make sense and
end up with Button component having 20 props…
Don’t use props to fulfill more use cases or make
component more generic then it should.
Atoms in most cases should have either 1-3 props or
a slot.
If you have more you probably overcomplicate
stuff.
Remember that every prop is API - too many of
them makes it hard for people to be „fluent” in your
library,
42. Don’t use props for
CSS classes
Using props for purely CSS-related
changes is: bad for many reasons
including:
- It adds abstraction layer that
gives you absolutely nothing in
return
- It;’s harder to understand what is
happening therefore to debug/
customize component
Bad
Good
43. Don’t use props for
CSS classes
If some modification is done
purely in CSS don’t make
meaningless abstraction
44. Don’t use props to
fulfill another use
case
If you try to fulfill more and more
use cases with props maybe it’s
better to provide a slot and leave
fulfilling different use cases to
developer.s
Props are great because they give
a lot out of the box but if you cut
on customization in return it’s
usually not worth it.
Bad
Good
45. Slots
The best way to make
components really generic and
context-less is to use slots.
Users can pass any content they
want inside of it so there are no
direct limitation as with props.
We cut a little bit of out-of-the-
box experience but got a lot of
customization in return.
46. Props & Slots
You can use slots in combination
with props to make components
easy to use out of the box while
keeping them generic and highly
customizable at the same time.
Divide your components template
into sections and use them as
default slot content.
Users can replace those sections
with their own HTML if they need
to.
Btw - Imagine fulfilling every use
case here with just props
47. Props & Slots
You can use slots in combination
with props to make components
easy to use out of the box while
keeping them generic and highly
customizable at the same time.
Divide your components template
into sections and use them as
default slot content.
Developers can replace those
sections with their own HTML if
they need to.
Btw - Imagine fulfilling every use
case here with just props
48. Props
Props are great if we want to
customize component for specific
use case.
They are not so good for a very
generic components though.
Props are perfectly suitable for
tasks like filling text blocks/
attributes, providing sources for
images and icons, changing
component behavior etc.
49. Revenue
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id
est laborum.
200%
lorem ipsum dolor
68%
lorem ipsum dolor
184%
lorem ipsum dolor
50. Presentation Title
What I learned after doing
Magento PWA for 1,5 year
Speaker
Name
Position @ Vue Storefront @nick @nick
52. This text is a little
introduction to
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis
nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu
fugiat nulla pariatur. Excepteur sint
occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id
est laborum.
This one
53. Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
54. Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
THIS ONE
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
SECOND ONE
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.
THIRD ONE HERE
55. Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore
et
This one
Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore
et
This one
Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore
et
This one
56. Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore
magna aliqua.
This one
59. Here you can show
future plans
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
2018
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
2019 2020
60. What if you want
to present few
ideas like
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
This feature
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
And this
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
And that one
62. Also this is
how we do it
If you really have to.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor
incididunt ut labore et dolore
magna
63. And what about this. Pretty cool huh?
If you really have to.
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor
incididunt ut labore et dolore
magna
66. 2014
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
ComScore
MOBILE TRAFFIC
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
Business Insider
MOBILE PAYMENTS
Lorem ipsum dolor sit amet, consectetur
adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna
Outerbox design
MOBILE FIRST DESIGN
45% 80%