File size: 651 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# DocsExample

This component is used to implement a skeleton for components examples which are generally showcased in the devdocs.

## How to use

```jsx
import DocsExample from 'calypso/devdocs/design/docs-example';

function render() {
	return (
		<DocsExample
			usageStats={ this.props.usageStats }
			toggleHandler={ this.toggleMyComponent }
			toggleText={ toggleText }
		>
			{ this.renderExamples() }
		</DocsExample>
	);
}
```

## Props

- `usageStats`: (object) An object containing the usage stats e.g. `{ count: 10 }`.
- `toggleHandler`: (func) A function to toggle the example state.
- `toggleText`: (string) Text for the toggle button.