-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(site): add ts-table docs (#1558)
- Loading branch information
Showing
9 changed files
with
4,765 additions
and
13,502 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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import React from 'react' | ||
import { TsTable } from '@vtex/shoreline-ts-table' | ||
import { Tag } from '@vtex/shoreline' | ||
|
||
const data: Product[] = [ | ||
{ | ||
name: 'iPhone 15', | ||
description: 'A nice phone', | ||
brand: 'Apple', | ||
category: 'smartphones', | ||
}, | ||
] | ||
|
||
interface Product { | ||
name: string | ||
description: string | ||
brand: string | ||
category: string | ||
} | ||
|
||
export default function Example() { | ||
return ( | ||
<TsTable | ||
data={data} | ||
columns={[ | ||
{ accessorKey: 'name' }, | ||
{ accessorKey: 'description' }, | ||
{ | ||
accessorKey: 'brand', | ||
cell: (cell) => <Tag>{cell.renderValue()}</Tag>, | ||
}, | ||
{ accessorKey: 'category' }, | ||
]} | ||
/> | ||
) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Usage with @tanstack/react-table | ||
|
||
<ComponentDescription name="ts-table" /> | ||
|
||
The `@vtex/shoreline-ts-table` has `@tanstack/react-table` as peer dependency. | ||
|
||
```sh npm2yarn copy | ||
npm i @tanstack/react-table @vtex/shoreline-ts-table | ||
``` | ||
|
||
<Preview name="ts-table" /> | ||
|
||
## Required props | ||
|
||
<PropsDocs name="ts-table" required /> | ||
|
||
## Optional props | ||
|
||
<PropsDocs name="ts-table" /> |
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
Oops, something went wrong.