Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout and Component Docs #816

Merged
merged 1 commit into from
Jan 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 45 additions & 8 deletions docs/content/api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,55 @@ These tags are for displaying textual content.
| <a name="list-item">**ListItem**</a> | [**Space**](/docs/props#space)<br />[**Color**](/docs/props#color)<br /> [**Typography**](/docs/props#typography) | — | **margin**: listMargin |
| <a name="code-span">**CodeSpan**</a> | [**Space**](/docs/props#space)<br />[**Color**](/docs/props#color)<br /> [**Typography**](/docs/props#typography) | — | **fontFamily**: monospace<br />**fontSize**: text |

## Layout Tags

These tags are for adding structure to your slides.

| Tag Name | Theme Props | Additional Props | Default Props |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- | ----------------- |
| <a name="box">**Box**</a> | [**Space**](/docs/props#space)<br />[**Color**](/docs/props#color)<br />[**Layout**](/docs/props#layout)<br />[**Position**](/docs/props#position)<br /> [**Border**](/docs/props#border) | — | — |
| <a name="flex-box">**FlexBox**</a> | [**Space**](/docs/props#space)<br />[**Color**](/docs/props#color)<br />[**Layout**](/docs/props#layout)<br />[**Position**](/docs/props#position)<br /> [**Border**](/docs/props#border)<br />[**Flex**](/docs/props#flex)<br /> | — | — |
| <a name="grid">**Grid**</a> | [**Layout**](/docs/props#layout)<br />[**Position**](/docs/props#position)<br />[**Grid**](/docs/props#grid)<br /> | — | **display**: grid |

<a name="progress"></a>

### Progress
## Progress

Progress is a component with no children that just shows dots for each slide in your deck. Visited and current slides are represented by a filled circle and future slides with just a stroke. The size and color are customizable.

| Props | Type | Example |
| ----- | ---------------- | --------- |
| size | PropTypes.number | `23` |
| color | PropTypes.string | `#abc123` |

Meant to serve as a callback to the origin Pacman-style progress bar from "Original Spectacle" (anything pre-v6). Add it to your presentation to give your audience a visual of progress throughout your presentation.
<a name="code-pane"></a>

```javascript
// index.js
// TODO - i'm sure this is wrong
<Deck>
<Progress />
</Deck>
## Code Pane

CodePane is a component for showing a syntax-highlighted block of source code. It will scroll for overflow amounts of code. The Code Pane will trim whitespace and normalize indents. It will also wrap long lines of code and preserve the indent. Optionally you can have the Code Pane fill the available empty space on your slide via the `autoFillHeight` prop. Themes are configurable objects and can be imported from the [prism-react-renderer themes](https://github.com/FormidableLabs/prism-react-renderer/tree/master/src/themes).

| Props | Type | Example |
| -------------- | ----------------- | --------------------- |
| autoFillHeight | PropTypes.boolean | `false` |
| children | PropTypes.string | `let name = "Carlos"` |
| fontSize | PropTypes.number | `16` |
| language | PropTypes.string | `javascript` |
| theme | Prism Theme | — |

```jsx
import lightTheme from 'prism-react-renderer/themes/nightOwlLight';

() => (
<Slide>
<CodePane language="javascript" theme={lightTheme}>
{`
function helloWorld() {
console.log('Hello World!');
}
`}
</CodePane>
</Slide>
);
```

<a name="deck-template"></a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
const Box = styled('div')(compose(space, layout, position, color, border));

const FlexBox = styled('div')(
compose(layout, space, flexbox, position, border)
compose(layout, space, flexbox, position, border, color)
);

FlexBox.defaultProps = {
Expand Down