@roots/ink-use-style
TypeScript icon, indicating that this package has built-in type declarations

5.8.7 • Public • Published

Bud

MIT License Follow Roots

@roots/ink-use-style

Overview

Theme hook for React Ink.

Installation

yarn add @roots/use-ink-style

Usage

import React from 'react'
import {Box, Text} from 'ink'
import {useStyle} from '@roots/use-ink-style'

const component = () => {
  const {col, ctx, colors} = useStyle()

  return (
    <Box width={col(3)}>
      <Text>3/12 column</Text>
    </Box>

    <Box width={ctx([col(12), col(6), col(3)])}>
      <Text>Sm: 12/12 column</Text>
      <Text>Md: 6/12 column</Text>
      <Text>Lg: 3/12 column</Text>
    </Box>

    <Text color={colors.primary}>
      Colorful.
    </Text>
  )
}

Contributing

Contributions are welcome from everyone.

We have contributing guidelines to help you get started.

Bud sponsors

Help support our open-source development efforts by becoming a patron.

Community

Keep track of development and community news.

Readme

Keywords

Package Sidebar

Install

npm i @roots/ink-use-style

Homepage

roots.io/bud

Weekly Downloads

14

Version

5.8.7

License

MIT

Unpacked Size

32.5 kB

Total Files

16

Last publish

Collaborators

  • qwp6t
  • swalkinshaw
  • retlehs
  • log1x
  • kellymears