JSPM

@roots/ink-use-style

5.8.7
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q28263F
  • License MIT

Themes and styles for React Ink

Package Exports

  • @roots/ink-use-style

Readme

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.