Open
Description
What:
The README should include the list of examples. Each example item should contain:
- A thumbnail image.
- A title.
- A short description on the example's purpose.
- A link to the interactive playground (Codesandbox) with the respective example.
Why:
Carefully designed, a list of examples may substitute documentation at its entirety. At least it's a great illustrative showcase for practical learners and beyond.
How:
I suggest to split examples into sections based on the complexity level.
Basics
- Basic composition. Example of two elements combining into a composition. Can be icon and text, or anything.
- Responsive props. Shows how to use Responsive props. Can utilize the previous "Basic composition" example, but improve it with some responsive props to show the change.
- Nested composition
Intermediate
- Conditional rendering. Showcases the usage of the
<Only/>
component. - Custom configuration. Example of using
Layout.configure()
to set custom breakpoints and custom measurement unit. - Demonstrate how to use the
query()
utility function to compose inline media queries instyled-components
Advanced
- Responsive sife effect. How to execute any side effect upon breakpoint change (
useResponsiveQuery
) - Responsive component. How to add Responsive props support to any React component.
- SSR of conditional components. How to use
<Visible/>
to conditionally render components and support client-side hydration.