Skip to content

Add interactive examples to README #256

Open
@kettanaito

Description

@kettanaito

What:

The README should include the list of examples. Each example item should contain:

  1. A thumbnail image.
  2. A title.
  3. A short description on the example's purpose.
  4. 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 in styled-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.

Metadata

Metadata

Assignees

Labels

DXThis issue improves developer's experiencein progress

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions