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

docs(Table): add attached example #598

Merged
merged 2 commits into from
Oct 3, 2016
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import React from 'react'
import { Table } from 'stardust'

const header = (
<Table.Header>
<Table.Row>
<Table.HeaderCell>Header</Table.HeaderCell>
<Table.HeaderCell>Header</Table.HeaderCell>
<Table.HeaderCell>Header</Table.HeaderCell>
</Table.Row>
</Table.Header>
)
const body = (
<Table.Body>
<Table.Row>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
<Table.Cell>Cell</Table.Cell>
</Table.Row>
</Table.Body>
)

const TableExampleAttached = () => (
<div>
<Table attached='top' basic>{header}{body}</Table>

<Table attached>
{body}
</Table>

<Table attached celled selectable>
{body}
</Table>

<Table attached='bottom' celled>
{header}
{body}
</Table>
</div>
)

export default TableExampleAttached
6 changes: 6 additions & 0 deletions docs/app/Examples/collections/Table/Variations/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ const Variations = () => {
examplePath='collections/Table/Variations/TableSingleLine'
/>

<ComponentExample
title='Attached'
description='A table can be attached to other content on a page'
examplePath='collections/Table/Variations/TableExampleAttached'
/>

<ComponentExample
title='Fixed'
description={
Expand Down
1 change: 1 addition & 0 deletions test/specs/collections/Table/Table-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ describe('Table', () => {
common.propKeyOnlyToClassName(Table, 'structured')
common.propKeyOnlyToClassName(Table, 'unstackable')

common.propKeyOrValueAndKeyToClassName(Table, 'attached')
common.propKeyOrValueAndKeyToClassName(Table, 'basic')
common.propKeyOrValueAndKeyToClassName(Table, 'compact')
common.propKeyOrValueAndKeyToClassName(Table, 'padded')
Expand Down