0.0.10 • Published 4 years ago

@yozora/react-table-cell v0.0.10

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

npm version npm download npm license module formats: cjs, esm Node Version React version styled-components version Tested With Jest Code Style: prettier

@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

    NameTypeRequiredDefaultDescription
    refReact.RefObject<HTMLTableCellElement>false-Forwarded ref callback
    childrenReact.ReactNodetrue-table cell contents
    isHeaderbooleanfalsefalseWhether is the table header cell
    alignleft|center|rightfalse-Table cell content align

    TableCellProps inherited all attributes of HTMLTableCellElement (React.HTMLAttributes<HTMLTableCellElement>)

  • Theme

    Prop NameDefault
    padding0.4rem 0.8rem
    borderColortransparent

    See YozoraTableCellTheme for details.

References

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago