-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from cwonrails/update-docs
docs: comprehensive edit
- Loading branch information
Showing
9 changed files
with
63 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
|
||
# Compositor Lab beta | ||
|
||
|
||
[Documentation](docs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,36 @@ | ||
|
||
# Composite Components | ||
|
||
In addition to creating primitive style components, | ||
Lab can be used to create multi-element composite components | ||
with the other style components in your library. | ||
In addition to creating primitive style components, Lab can be used to create multi-element composite components with the other style components in your library. | ||
|
||
To create a composite component, click the *Add* button in the upper right, | ||
then click the *Composite Component* tab. | ||
To create a composite component, click the _Add_ button in the upper right, then click the _Composite Component_ tab. | ||
|
||
![library view](images/composite-library.png) | ||
|
||
![composite component tab](images/composite-tab.png) | ||
|
||
Next, in the *Imports* field start typing the name of the components that | ||
you plan to use for creating the composite component. | ||
A list of available components will appear in the text below the form field. | ||
Next, in the _Imports_ field start typing the name of the components that you plan to use for creating the composite component. A list of available components will appear in the text below the form field. | ||
|
||
**Note:** Lab currently only supports creating composite components with primitive style components and extended components; | ||
other composite components cannot be imported. | ||
**Note:** Lab currently only supports creating composite components with primitive style components and extended components; other composite components cannot be imported. | ||
|
||
![composite component imports field](images/composite-imports.png) | ||
|
||
Next, in the JSX editor, start using the imported components to build a composite component. | ||
To allow the values used in the composite component to be changed dynamically, use [React props][react-props]. | ||
Next, in the JSX editor, start using the imported components to build a composite component. To allow the values used in the composite component to be changed dynamically, use React [`props`][props]. | ||
|
||
Don't worry if the component isn't perfect at this step, you'll be able to edit it in the next step. | ||
|
||
![composite component JSX field](images/composite-jsx.png) | ||
|
||
Give your new component a unique name, then click the *Create Component* button to add the component to your library and start editing it. | ||
Give your new component a unique name, then click the _Create Component_ button to add the component to your library and start editing it. | ||
|
||
![composite component name field](images/composite-name.png) | ||
|
||
To start, make sure you add an example in the *Examples* editor to give your component some test content. | ||
To start, make sure you add an example in the _Examples_ editor to give your component some test content. | ||
|
||
![composite component examples](images/composite-examples.png) | ||
|
||
Since Lab components use [styled-system][system] you can adjust things like margin, padding and font-size for the components | ||
used in your composite component. | ||
|
||
Since Lab components use [`styled-system`][system] you can adjust things like margin, padding and font-size for the components used in your composite component. | ||
|
||
- Next: [Importing Components](importing.md) | ||
|
||
[system]: https://github.com/jxnblk/styled-system | ||
[react-props]: https://reactjs.org/docs/components-and-props.html | ||
[props]: https://reactjs.org/docs/components-and-props.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters