Skip to content

Commit 3e8a02a

Browse files
committed
add header content examples
1 parent d7d6230 commit 3e8a02a

5 files changed

Lines changed: 75 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import React, {Component} from 'react';
2+
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample';
3+
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection';
4+
5+
export default class HeaderTypesExamples extends Component {
6+
render() {
7+
return (
8+
<ExampleSection title='Content'>
9+
<ComponentExample
10+
title='Image'
11+
description='A header may contain an image'
12+
examplePath='elements/Header/Content/HeaderImageExample'
13+
/>
14+
<ComponentExample
15+
title='Icon'
16+
description='A header may contain an icon'
17+
examplePath='elements/Header/Content/HeaderIconExample'
18+
/>
19+
<ComponentExample
20+
title='Subheader'
21+
description='Headers may contain subheaders'
22+
examplePath='elements/Header/Content/HeaderSubheaderExample'
23+
/>
24+
</ExampleSection>
25+
);
26+
}
27+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, {Component} from 'react';
2+
import {Header} from 'stardust';
3+
4+
export default class HeaderIconExample extends Component {
5+
render() {
6+
const plug = <i className='plug icon' />;
7+
return (
8+
<Header.H2 icon={plug}>
9+
<div className='content'>
10+
Is Your Electricity Truly Electrifying?
11+
</div>
12+
</Header.H2>
13+
);
14+
}
15+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import faker from 'faker';
2+
import React, {Component} from 'react';
3+
import {Header, Image} from 'stardust';
4+
5+
export default class HeaderImageExample extends Component {
6+
render() {
7+
const photo = <Image className='circular' src={faker.image.city()} />;
8+
return (
9+
<Header.H2 image={photo}>
10+
<div className='content'>
11+
Welcome to Our City!
12+
</div>
13+
</Header.H2>
14+
);
15+
}
16+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React, {Component} from 'react';
2+
import {Header} from 'stardust';
3+
4+
export default class HeaderImageExample extends Component {
5+
render() {
6+
return (
7+
<Header.H2>
8+
Account Settings
9+
<div className='sub header'>
10+
Manage your account settings and set email preferences
11+
</div>
12+
</Header.H2>
13+
);
14+
}
15+
}

docs/app/Examples/elements/Header/HeaderExamples.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, {Component} from 'react';
22
import HeaderTypesExamples from './Types/HeaderTypesExamples';
3+
import HeaderContentExamples from './Content/HeaderContentExamples';
34
// import HeaderStatesExamples from './States/HeaderStatesExamples';
45
// import HeaderVariationsExamples from './Variations/HeaderVariationsExamples';
56

@@ -9,6 +10,7 @@ export default class HeaderExamples extends Component {
910
<div>
1011
TODO: explain semantic uses divs and h* tags and how we accomplish that with Header and HEader.H*
1112
<HeaderTypesExamples />
13+
<HeaderContentExamples />
1214
</div>
1315
);
1416
}

0 commit comments

Comments
 (0)