0.0.10 • Published 4 years ago
@yozora/react-table-cell v0.0.10
@yozora/react-table-cell
This package is designed to render mdast table cell type data
Install
npm
npm install --save @yozora/react-table-cell
yarn
yarn add @yozora/react-table-cell
Usage
Use in React project
Pure
import React from 'react' import TableCell from '@yozora/react-table-cell' const wrapper = ( <table> <tbody> <tr> <TableCell style={ { color: 'orange', fontSize: '16px' } }> some text1 <span>some text2</span> </TableCell> </tr> </tbody> </table> )
With theme
import React from 'react' import { DefaultTheme, ThemeProvider } from 'styled-components' import TableCell from '@yozora/react-table-cell' const theme: DefaultTheme = { yozora: { tableCell: { // padding: '0.4rem', borderColor: 'red', } } } const wrapper = ( <ThemeProvider theme={ theme }> <table> <tbody> <tr> <TableCell style={ { color: 'orange', fontSize: '16px' } }> some text1 <span>some text2</span> </TableCell> </tr> </tbody> </table> </ThemeProvider> )
Props
Name Type Required Default Description ref
React.RefObject<HTMLTableCellElement>
false
- Forwarded ref callback children
React.ReactNode
true
- table cell contents isHeader
boolean
false
false
Whether is the table header cell align
left|center|right
false
- Table cell content align TableCellProps inherited all attributes of
HTMLTableCellElement
(React.HTMLAttributes<HTMLTableCellElement>
)Theme
Prop Name Default padding 0.4rem 0.8rem
borderColor transparent
See YozoraTableCellTheme for details.